Check whether the given Iterator contains the given element.

@param iterator the Iterator to check.
@param element the element to look for.

@return {@code true} if found, {@code false} else.
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;
    }
191929
public boolean isEmpty(F element){
        if (isEmpty())
            return true;

        Counter<S> m = maps.get(element);
        if (m == null)
            return true;
        else
            return m.isEmpty();
    }
1243641
@Override
    public boolean containsInstance(int value, T instance) {
    	if (root == null) return false;
    	if (value < first.value) return false;
    	if (value > last.value) return false;
    	if (value == first.value && instance == first.element) return true;
    	if (value == last.value && instance == last.element) return true;
    	return containsInstance(root, value, instance);
    }
845830
public static boolean isAllNull(Iterator<?> iter) {
		if (null == iter) {
			return true;
		}

		while (iter.hasNext()) {
			if (null != iter.next()) {
				return false;
			}
		}
		return true;
	}
733372
@Override
    public boolean contains(long value, T element) {
    	if (root == null) return false;
    	if (value < first.value) return false;
    	if (value > last.value) return false;
    	if (value == first.value && ObjectUtil.equalsOrNull(element, first.element)) return true;
    	if (value == last.value && ObjectUtil.equalsOrNull(element, last.element)) return true;
    	return contains(root, value, element);
    }
645282
@Override
    public boolean checkCondition(IValue test) throws FilterException {
        Iterator iter = values.iterator();
        while (iter.hasNext()) {
            IValue value = (IValue) iter.next();
            if (value.containedBy(test)) {
                return true;
            }
        }
        return false;
    }
678641
public boolean contains(Object e) {
        if (e == null)
            return false;
        Class<?> eClass = e.getClass();
        if (eClass != elementType && eClass.getSuperclass() != elementType)
            return false;

        int eOrdinal = ((Enum<?>)e).ordinal();
        return (elements[eOrdinal >>> 6] & (1L << eOrdinal)) != 0;
    }
794793
@Override
    public final boolean containsAll(final Collection<? extends E> collection) {
        for(E element : collection) {
            if(!this.contains(element)) {
                return false;
            }
        }
        return true;
    }
978695
public static boolean isElementPresent(String locator) {
        logger.entering(locator);
        boolean flag = false;
        try {
            flag = HtmlElementUtils.locateElement(locator) != null;
        } catch (NoSuchElementException e) { // NOSONAR
        }
        logger.exiting(flag);
        return flag;
    }
1247675
public boolean contains(Object o) {
    Iterator<E> iter = iterator();
    while (iter.hasNext()) {
      if (iter.next() == o) {
        return true;
      }
    }
    return false;
  }
1180742
private boolean hasNextSafely(Iterator iterator) {
        try {
            /* Throw a ServiceConfigurationError if a provider-configuration file violates the specified format,
+            or if it names a provider class that cannot be found and instantiated, or if the result of
+            instantiating the class is not assignable to the service type, or if any other kind of exception
+            or error is thrown as the next provider is located and instantiated.
+            @see http://docs.oracle.com/javase/7/docs/api/java/util/ServiceLoader.html#iterator()
+            */
            return iterator.hasNext();
        } catch (Exception e) {
            LOGGER.error("iterator.hasNext() failed", e);
            return false;
        }
    }
999760
@Override
  public boolean hasNext() {
    while (!(iteratorList.isEmpty() || iteratorList.get(currentIteratorIndex).hasNext())) {
      Assert.isFalse(iteratorList.remove(currentIteratorIndex).hasNext(), "removing a non-empty Iterator");
      currentIteratorIndex = (iteratorList.isEmpty() ? 0 : (currentIteratorIndex % iteratorList.size()));
    }

    return !iteratorList.isEmpty();
  }
237081
@SuppressWarnings("unchecked")
  public boolean contains(final Object key) {
    // validate key
    if (key == null) {
      throw new IllegalArgumentException("Null element is not supported.");
    }
    // find element
    final int hashCode = ((T)key).hashCode();
    final int index = getIndex(hashCode);
    return containsElem(index, (T) key, hashCode);
  }
994872
private boolean existsIn(String element, String[] a) {
        for (String s : a) {
            if (element.equals(s)) {
                return true;
            }
        }
        return false;
    }
874273
public <E extends T> Iterator<E> filter (final Iterator<E> input)
    {
        return new Iterator<E>() {
            // from Iterator
            public boolean hasNext ()
            {
                return _found || findNext();
            }

            // from Iterator
            public E next ()
            {
                if (_found || findNext()) {
                    _found = false;
                    return _last;

                } else {
                    throw new NoSuchElementException();
                }
            }

            // from Iterator
            public void remove ()
            {
                if (_removeable) {
                    _removeable = false;
                    input.remove();

                } else {
                    throw new IllegalStateException();
                }
            }

            private boolean findNext ()
            {
                boolean result = false;
                while (input.hasNext()) {
                    E candidate = input.next();
                    if (isMatch(candidate)) {
                        _last = candidate;
                        result = true;
                        break;
                    }
                }

                _found = result;
                _removeable = result;
                return result;
            }

            private E _last;
            private boolean _found; // because _last == null is a valid element
            private boolean _removeable;
        };
    }
1283638
public static boolean hasNull(Iterator<?> iter) {
		if (null == iter) {
			return true;
		}
		while (iter.hasNext()) {
			if (null == iter.next()) {
				return true;
			}
		}

		return false;
	}
1293362
public boolean contains(Matcher matcher) {
        return element.matcher == matcher || (parent != null && parent.contains(matcher));
    }