<p>Finds warehouse rest line by item ID.</p>
@param pItemId Item ID
@param pRestList Rest List
@return Warehouse rest line or null if not found
338505
public final WarehouseRestLineSm findRest(final Long pItemId,
    final List<WarehouseRestLineSm> pRestList) {
    for (WarehouseRestLineSm wr : pRestList) {
      if (wr.getInvItemId().equals(pItemId)) {
        return wr;
      }
    }
    return null;
  }
13993
@Override
	public  T listGetPrevious(final T currentElement) {

		Relation<T, T, OneStartpoint<T>, OneEndpoint<T>> prevRel = currentElement.getIncomingRelationship(getSiblingLinkType());
		if (prevRel != null) {

			return (T)prevRel.getSourceNode();
		}

		return null;
	}
371407
public Set<Integer> getFullEndPositionList(int docId, int position)
      throws IOException {
    if (ignoreSpans != null && docId == currentDocId) {
      if (position < minimumPosition) {
        throw new IOException(
            "Unexpected startPosition, should be >= " + minimumPosition + "!");
      } else {
        computeFullEndPositionList(position);
        return fullEndPositionList.get(position);
      }
    } else {
      return null;
    }
  }
1115305
private Iterator<String> getSpaceListing(final StorageProvider store,
                                             final String spaceId)
        throws TaskExecutionFailedException {
        try {
            return new Retrier().execute(new Retriable() {
                @Override
                public Iterator<String> retry() throws Exception {
                    // The actual method being executed
                    return store.getSpaceContents(spaceId, null);
                }
            });
        } catch (Exception e) {
            String msg = "Error attempting to retrieve space listing: " +
                         e.getMessage();
            throw new DuplicationTaskExecutionFailedException(
                buildFailureMessage(msg), e);
        }
    }
1040823
@Override
	public List<CommerceNotificationQueueEntry> findBySent(boolean sent) {
		return findBySent(sent, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
1366946
protected final <T extends AItemSpecifics<?,  ?>> int findFirstIdxFor(final List<T> pOutdGdSpList, final IHasIdLongVersionName pItem) {
    int j = 0;
    while (!pOutdGdSpList.get(j).getItem().getItsId().equals(pItem.getItsId())) {
      j++;
    }
    return j;
  }
276762
private void checkItemsListState(final List<InvoiceItem> orderedList) {

        LocalDate prevRecurringEndDate = null;
        LocalDate prevRepairEndDate = null;
        for (InvoiceItem cur : orderedList) {
            switch (cur.getInvoiceItemType()) {
                case FIXED:
                    break;

                case RECURRING:
                    if (prevRecurringEndDate != null) {
                        Preconditions.checkState(prevRecurringEndDate.compareTo(cur.getStartDate()) <= 0);
                    }
                    prevRecurringEndDate = cur.getEndDate();
                    break;

                case REPAIR_ADJ:
                    if (prevRepairEndDate != null) {
                        Preconditions.checkState(prevRepairEndDate.compareTo(cur.getStartDate()) <= 0);
                    }
                    prevRepairEndDate = cur.getEndDate();
                    break;

                default:
                    Preconditions.checkState(false, "Unexpected item type " + cur.getInvoiceItemType());
            }
        }
    }
1302911
public final AbstractItem findOldestItem() throws MessageStoreException
    {
        AbstractItem item = null;
        AbstractItemLink oldestLink = null;
        long oldestPositionSoFar = Long.MAX_VALUE;
        for (int priority = Priorities.LOWEST_PRIORITY; priority <= Priorities.HIGHEST_PRIORITY; priority++)
        {
            LinkedList list = _prioritySublists[priority];
            if (null != list)
            {
                AbstractItemLink link = (AbstractItemLink) list.getHead();
                if (null != link)
                {
                    final long pos = link.getPosition();
                    if (pos < oldestPositionSoFar)
                    {
                        oldestPositionSoFar = pos;
                        oldestLink = link;
                    }
                }
            }
        }
        if (null != oldestLink)
        {
            item = oldestLink.getItem();
        }
        return item;
    }
73614
public static int getListYScroll(@NonNull final ListView list) {
        View child = list.getChildAt(0);
        return child == null ? -1
            : list.getFirstVisiblePosition() * child.getHeight() - child.getTop() + list.getPaddingTop();
    }
1092760
@Override
    public C.List<T> prepend(C.List<T> list) {
        return prependList(list);
    }
98122
public static @CheckForNull <T extends Descriptor> T findById(Collection<? extends T> list, String id) {
        for (T d : list) {
            if(d.getId().equals(id))
                return d;
        }
        return null;
    }
813898
function goNextPrevDoc(inc, listOrder) {
        var result;
        if (listOrder) {
            result = MainViewManager.traverseToNextViewInListOrder(inc);
        } else {
            result = MainViewManager.traverseToNextViewByMRU(inc);
        }

        if (result) {
            var file = result.file,
                paneId = result.paneId;

            MainViewManager.beginTraversal();
            CommandManager.execute(Commands.FILE_OPEN, {fullPath: file.fullPath,
                                                        paneId: paneId });

            // Listen for ending of Ctrl+Tab sequence
            if (!_addedNavKeyHandler) {
                _addedNavKeyHandler = true;
                $(window.document.body).keyup(detectDocumentNavEnd);
            }
        }
    }
218141
@Override
  protected MtasDataItemDoubleFull getItem(int i) {
    if (i >= 0 && i < size) {
      return new MtasDataItemDoubleFull(
          ArrayUtils.toPrimitive(fullValueList[i]),
          hasSub() ? subCollectorListNextLevel[i] : null, getStatsItems(),
          sortType, sortDirection, errorNumber[i], errorList[i],
          sourceNumberList[i]);
    } else {
      return null;
    }
  }
734841
public final void doWork(final HttpServletRequest pReq,
    final HttpServletResponse pResp) throws ServletException, IOException {
    pReq.setCharacterEncoding("UTF-8");
    pResp.setCharacterEncoding("UTF-8");
    IFactoryAppBeans factoryAppBeans = null;
    try {
      HashMap<String, Object> reqVars = new HashMap<String, Object>();
      factoryAppBeans = (IFactoryAppBeans) getServletContext()
          .getAttribute("IFactoryAppBeans");
      HttpRequestData requestData = new HttpRequestData(pReq, pResp);
      requestData.setAttribute("reqVars", reqVars);
      IHandlerRequest hndlI18nRequest = (IHandlerRequest)
        factoryAppBeans.lazyGet("hndlI18nRequest");
      hndlI18nRequest.handle(reqVars, requestData);
      IMngSoftware mngSoftware = (IMngSoftware) factoryAppBeans
        .lazyGet("IMngSoftware");
      ISrvI18n srvI18n = (ISrvI18n) factoryAppBeans.lazyGet("ISrvI18n");
      UtlJsp utlJsp = (UtlJsp) factoryAppBeans.lazyGet("UtlJsp");
      String dbgShStr = pReq.getParameter("dbgSh");
      if (dbgShStr != null) {
        mngSoftware.setDbgSh(Boolean.valueOf(dbgShStr));
      }
      String dbgFlStr = pReq.getParameter("dbgFl");
      if (dbgFlStr != null) {
        mngSoftware.setDbgFl(Integer.parseInt(dbgFlStr));
      }
      String dbgClStr = pReq.getParameter("dbgCl");
      if (dbgClStr != null) {
        mngSoftware.setDbgCl(Integer.parseInt(dbgClStr));
      }
      pReq.setAttribute("mngSoftware", mngSoftware);
      pReq.setAttribute("srvI18n", srvI18n);
      pReq.setAttribute("utlJsp", utlJsp);
      String nmRnd = pReq.getParameter("nmRnd");
      String path = dirJsp + nmRnd + ".jsp";
      RequestDispatcher rd = getServletContext().getRequestDispatcher(path);
      rd.include(pReq, pResp);
    } catch (Exception e) {
      if (factoryAppBeans != null) {
        ILog logger = null;
        try {
          logger = (ILog) factoryAppBeans.lazyGet("ILog");
        } catch (Exception e1) {
          e1.printStackTrace();
        }
        if (logger != null) {
          logger.error(null, getClass(), "WORK", e);
        } else {
          e.printStackTrace();
        }
      } else {
        e.printStackTrace();
      }
      if (e instanceof ExceptionWithCode) {
        pReq.setAttribute("error_code",
          ((ExceptionWithCode) e).getCode());
        pReq.setAttribute("short_message",
          ((ExceptionWithCode) e).getShortMessage());
      } else {
        pReq.setAttribute("error_code",
          HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
      }
      pReq.setAttribute("javax.servlet.error.status_code",
        HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
      pReq.setAttribute("javax.servlet.error.exception", e);
      pReq.setAttribute("javax.servlet.error.request_uri",
        pReq.getRequestURI());
      pReq.setAttribute("javax.servlet.error.servlet_name", this.getClass()
        .getCanonicalName());
      pResp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    }
  }
455225
@Override
    public long getItemId(int position) {
        if (shouldInsertItemAtPosition(position)) {
            return getItem(position).getIdentifier();
        } else {
            return mAdapter.getItemId(position - itemInsertedBeforeCount(position));
        }
    }
541477
@Programmatic // not part of metamodel
    public List<ExcelWicketToDoItem> autoComplete(final String description) {
        return container.allMatches(
                new QueryDefault<>(ExcelWicketToDoItem.class,
                        "todo_autoComplete", 
                        "ownedBy", currentUserName(), 
                        "description", description));
    }
223560
public static <T> T getLast(List<T> list) {
		if (isEmpty(list)) {
			return null;
		}

		return list.get(list.size() - 1);
	}