Determines whether a given predicate holds true for at least
one element.

<p>Returns false for an empty sequence.</p>
765953
public static <T> boolean any(final Iterable<T> sequence,
                                  final Predicate<? super T> predicate) {
        for (T t : sequence) {
            if (predicate.test(t)) {
                return true;
            }
        }
        return false;
    }
1016885
public boolean matchesAny(String... seq) {
        for (String s : seq) {
            if (matches(s))
                return true;
        }
        return false;
    }
181035
public static boolean contains(Iterator<?> iterator, Object element) {
        if (iterator != null) {
            while (iterator.hasNext()) {
                Object candidate = iterator.next();
                if (ObjectUtils.nullSafeEquals(candidate, element)) {
                    return true;
                }
            }
        }
        return false;
    }
559902
public boolean hasSameBounds(ForAll t, ForAll s) {
        List<Type> l1 = t.tvars;
        List<Type> l2 = s.tvars;
        while (l1.nonEmpty() && l2.nonEmpty() &&
               isSameType(l1.head.getUpperBound(),
                          subst(l2.head.getUpperBound(),
                                s.tvars,
                                t.tvars))) {
            l1 = l1.tail;
            l2 = l2.tail;
        }
        return l1.isEmpty() && l2.isEmpty();
    }
438830
public boolean contains(int ele) {
        int idx;

        idx = ele >> SHIFT;
        if (idx >= data.length) {
            return false;
        }
        return (data[idx] & (1 << ele)) != 0;
    }
618170
public boolean every(Func1<? super T, Boolean> predicate) {
        for (T item : this) {
            if (!predicate.call(item))
                return false;
        }
        return true;
    }
387776
private boolean containsSeq(String seq) {
        int state = 0;
        for (int i = 0; i < seq.length(); i++) {
            state = next(state, seq.charAt(i));

            if (state == -1)
                return false;
        }

        return d_finalStates.get(state);
    }
622224
private boolean validBooleanExpression(Node expr) {
    if (isBooleanOperation(expr)) {
      return validBooleanOperation(expr);
    }

    if (!isOperation(expr)) {
      warnInvalidExpression("boolean", expr);
      return false;
    }
    if (!isValidPredicate(getCallName(expr))) {
      warnInvalid("boolean predicate", expr);
      return false;
    }
    Keywords keyword = nameToKeyword(getCallName(expr));
    if (!checkParameterCount(expr, keyword)) {
      return false;
    }
    switch (keyword.kind) {
      case TYPE_PREDICATE:
        return validTypePredicate(expr, getCallParamCount(expr));
      case STRING_PREDICATE:
        return validStringPredicate(expr, getCallParamCount(expr));
      case TYPEVAR_PREDICATE:
        return validTypevarPredicate(expr, getCallParamCount(expr));
      default:
        throw new IllegalStateException("Invalid boolean expression");
    }
  }
844187
@Override
  public boolean contains(final int x) {
    final short hb = highbits(x);
    int index = highLowContainer.getContainerIndex(hb);
    return index >= 0
        && highLowContainer.containsForContainerAtIndex(index, lowbits(x));
  }
1340345
public boolean hasPrevious() {
        // If we are at the start of the list there are no previous elements.
        if (currentIndex == startIndex) {
            return false;
        }
        // Otherwise, see if previous Element is null. If so, try to load the
        // previous element to make sure it exists.
        if (previousElement == null) {
            previousElement = getPreviousElement();
            // If getting the previous element failed, return false.
            if (previousElement == null) {
                return false;
            }
        }
        return true;
    }
96753
@NotNull
    public OptionalBoolean filter(@NotNull BooleanPredicate predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : OptionalBoolean.empty();
    }
414864
@Override
  public boolean contains(final int x) {
    final short hb = Util.highbits(x);
    final Container c = highLowContainer.getContainer(hb);
    return c != null && c.contains(Util.lowbits(x));
  }
805968
private boolean containsElements(final Collection<?> coll) {
        if (coll == null || coll.isEmpty()) {
            return false;
        }
        for (final Object name : coll) {
            if (name != null) {
                return true;
            }
        }
        return false;
    }
181365
public boolean contains(final T element) {
        if (element == null) {
            return false;
        }

        return lowerEndpoint.includes(element) && upperEndpoint.includes(element);
    }
591095
@SuppressWarnings("unchecked")
	public static <T> boolean hasNull(T... array) {
		if (isNotEmpty(array)) {
			for (T element : array) {
				if (null == element) {
					return true;
				}
			}
		}
		return false;
	}
1153579
boolean contains(WriteOrder<?> e) {
    return (e.getPreviousInWriteOrder() != null)
        || (e.getNextInWriteOrder() != null)
        || (e == first);
  }
1147146
public void hasFirstElement(@NullableDecl Object element) {
    if (actualAsNavigableSet().isEmpty()) {
      failWithActual("expected to have first element", element);
      return;
    }

    if (!Objects.equal(actualAsNavigableSet().first(), element)) {
      if (actualAsNavigableSet().contains(element)) {
        failWithoutActual(
            simpleFact(
                lenientFormat(
                    "Not true that %s has first element <%s>. "
                        + "It does contain this element, but the first element is <%s>",
                    actualAsString(), element, actualAsNavigableSet().first())));
        return;
      }
      failWithoutActual(
          simpleFact(
              lenientFormat(
                  "Not true that %s has first element <%s>. "
                      + "It does not contain this element, and the first element is <%s>",
                  actualAsString(), element, actualAsNavigableSet().first())));
    }
  }