An implementation of this method is provided in the derived XPath class. In the
parent class it merely returns null.

@param firstList
@param val1
@param lessThan
@param permissive
@param overallTrue
@return
326475
protected Boolean compareList( // was BooleanValue
      ArrayList firstList,
      Object val1,
      boolean lessThan,
      boolean permissive,
      boolean overallTrue) // If true we are searching for at least one TRUE result, else at least one FALSE.
    {
      if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.entry(cclass, 
                 "compareList", 
                 new Object[] { firstList, 
                                val1, 
                                new Boolean(lessThan), 
                                new Boolean(permissive), 
                                new Boolean(overallTrue) });

      Boolean finalReturn = null;

      if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
        tc.exit(cclass, "compareList", finalReturn);       
      return finalReturn;
    }
85642
@SuppressWarnings("unchecked")
	public static <T> T firstNonNull(T... array) {
		if (isNotEmpty(array)) {
			for (final T val : array) {
				if (null != val) {
					return val;
				}
			}
		}
		return null;
	}
912018
@SuppressWarnings("unchecked")
  <T extends GraphNode<N, E>> T getNodeOrFail(N val) {
    T node = (T) getNode(val);
    if (node == null) {
      throw new IllegalArgumentException(val + " does not exist in graph");
    }
    return node;
  }
697505
private E firstDataItem() {
        for (Node p = head; p != null; p = succ(p)) {
            Object item = p.item;
            if (p.isData) {
                if (item != null && item != p)
                    return LinkedTransferQueue.<E>cast(item);
            }
            else if (item == null)
                return null;
        }
        return null;
    }
1162868
public Node firstChild() {

		if (currentNode == null)
			return null;

		Node node = getFirstChild(currentNode);

		if (node != null)
			currentNode = node;

		return node;
	}
506304
@Override
    public int first() {
        fCachedBreakPositions = null;
        fDictionaryCharCount = 0;
        fPositionInCache = 0;
        fLastRuleStatusIndex  = 0;
        fLastStatusIndexValid = true;
        if (fText == null) {
            return BreakIterator.DONE;
        }
        fText.first();
        return fText.getIndex();
    }
64163
public static List<String> getList(final String val, final boolean emptyOk) throws Throwable {
    List<String> l = new LinkedList<String>();

    if ((val == null) || (val.length() == 0)) {
      return l;
    }

    StringTokenizer st = new StringTokenizer(val, ",", false);
    while (st.hasMoreTokens()) {
      String token = st.nextToken().trim();

      if ((token == null) || (token.length() == 0)) {
        if (!emptyOk) {
          // No empty strings

          throw new Exception("List has an empty element.");
        }
        l.add("");
      } else {
        // Got non-empty element
        l.add(token);
      }
    }

    return l;
  }
1054951
function getFirstAnchor(list) {
      var result = null;
      Array.prototype.some.call(list, function(element) {
        if (nodeName_(element) === 'a') {
          result = element;
          return true;
        }
      });
      return result;
    }
828187
public static final <T extends Comparable<T>> int comparator(T val1, T def1, T val2, T def2) {
		return comparator(val1 == null? def1 : val1, val2 == null? def2 : val2);
		// return (val1 == null? def1 : val1).compareTo(val2 == null? def2 : val2);
	}
583387
public String firstMandatoryNullProperty()
    {
        for (String property : model.propertyList)
        {
            if (
                    model.mandatorySet.contains(property) && 
                    model.defaultMap.get(property) == null &&
                data.get(property) == null
                    )
            {
                return property;
            }
        }
        return firstMandatoryNullProperty(model.propertyList);
    }
872980
@Override
	public <T> T first(final Class<T> type) {
		return findFirst(type).orElseThrow(() -> new DataNotFoundException("query result is empty."));
	}
672707
@SuppressWarnings("PointlessArithmeticExpression")
    int getDataFirstRecord(final int territoryNumber) {
        assert (0 <= territoryNumber) && (territoryNumber <= Territory.AAA.getNumber());
        return index[territoryNumber + POS_INDEX_FIRST_RECORD];
    }
529572
public static ListValue of(LatLng first, LatLng... other) {
    return newBuilder().addValue(first, other).build();
  }
578084
public static <S, I, T, D> boolean breadthFirst(TransitionSystem<S, ? super I, T> ts,
                                                    int limit,
                                                    Collection<? extends I> inputs,
                                                    TSTraversalVisitor<S, I, T, D> vis) {
        Deque<BFSRecord<S, D>> bfsQueue = new ArrayDeque<>();

        // setting the following to false means that the traversal had to be aborted
        // due to reaching the limit
        boolean complete = true;
        int stateCount = 0;

        Holder<D> dataHolder = new Holder<>();

        for (S initS : ts.getInitialStates()) {
            dataHolder.value = null;
            TSTraversalAction act = vis.processInitial(initS, dataHolder);
            switch (act) {
                case ABORT_TRAVERSAL:
                    return complete;
                case EXPLORE:
                    if (stateCount != limit) {
                        bfsQueue.offer(new BFSRecord<>(initS, dataHolder.value));
                        stateCount++;
                    } else {
                        complete = false;
                    }
                    break;
                default: // case ABORT_INPUT: case ABORT_STATE: case IGNORE:
            }
        }

        while (!bfsQueue.isEmpty()) {
            BFSRecord<S, D> current = bfsQueue.poll();

            S state = current.state;
            D data = current.data;

            if (!vis.startExploration(state, data)) {
                continue;
            }

            inputs_loop:
            for (I input : inputs) {
                Collection<T> transitions = ts.getTransitions(state, input);

                for (T trans : transitions) {
                    S succ = ts.getSuccessor(trans);

                    dataHolder.value = null;
                    TSTraversalAction act = vis.processTransition(state, data, input, trans, succ, dataHolder);

                    switch (act) {
                        case ABORT_INPUT:
                            continue inputs_loop;
                        case ABORT_STATE:
                            break inputs_loop;
                        case ABORT_TRAVERSAL:
                            return complete;
                        case EXPLORE:
                            if (stateCount != limit) {
                                bfsQueue.offer(new BFSRecord<>(succ, dataHolder.value));
                                stateCount++;
                            } else {
                                complete = false;
                            }
                            break;
                        case IGNORE:
                            break;
                        default:
                            throw new IllegalStateException("Unknown action " + act);
                    }
                }
            }
        }

        return complete;
    }
38310
@SafeVarargs
    public static <T> List<T> buildListOfAtLeastTwo(T first, T second, T... more) {
        if (first == null) {
            throw new IllegalArgumentException("First example is null.");
        }
        if (second == null) {
            throw new IllegalArgumentException("Second example is null.");
        }

        List<T> result = new ArrayList<>();
        result.add(first);
        result.add(second);
        addArrayElementsToList(result, more);

        return result;
    }
212696
public static <T extends Comparable<T>> T leq(T value) {
        reportMatcher(new LessOrEqual<T>(value));
        return null;
    }
842214
@SuppressWarnings("checkstyle:rightCurly")
  static <T> ImmutableList<T> sortMostSpecificFirst(final Iterable<T> classes,
      final Function<T, Class<?>> toClass) {
    final List<T> working = Lists.newArrayList();
    // strip duplicates
    for (final T t : classes) {
      if (!working.contains(t)) {
        working.add(t);
      }
    }
    final List<T> sorted = Lists.newArrayList();
    final Predicate<T> mostSpecific = createMostSpecificMatchPredicate(working, toClass);
    boolean changed = false;
    do {
      changed = false;
      for (final Iterator<T> iterator = working.iterator(); iterator.hasNext();) {
        final T t = iterator.next();
        if (mostSpecific.apply(t)) {
          sorted.add(t);
          iterator.remove();
          changed = true;
        }
      }
    } while (changed);
    if (!working.isEmpty()) {
      throw new IllegalStateException(
          "Unable to find a element that does not have a more specific element in the set "
              + working);
    }
    return ImmutableList.copyOf(sorted);
  }