public static <T>boolean contains(Iterator<T> iterator,T element){
  if (iterator != null) {
    while (iterator.hasNext()) {
      T candidate=iterator.next();
      if (ObjectUtils.nullSafeEquals(candidate,element))       return true;
    }
  }
  return false;
}

public static < T > boolean contains ( Iterator < T > iterator , T element ) { if ( iterator != null ) { while ( iterator . hasNext ( ) ) { T candidate = iterator . next ( ) ; if ( ObjectUtils . nullSafeEquals ( candidate , element ) ) return true ; } } return false ; }
check whether the given iterator contains the given element .
