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 ; }
Check whether the given Iterator contains the given element .