public void filter(final Collection<T> collection){
  if (collection != null) {
    final Iterator<T> iter=collection.iterator();
    while (iter.hasNext()) {
      final T o=iter.next();
      if (!passesAllCriteria(o)) {
        iter.remove();
      }
    }
  }
}

public void filter ( final Collection < T > collection ) { if ( collection != null ) { final Iterator < T > iter = collection . iterator ( ) ; while ( iter . hasNext ( ) ) { final T o = iter . next ( ) ; if ( ! passesAllCriteria ( o ) ) { iter . remove ( ) ; } } } }
starts the filtering process . for each object in the collection , all filtercriteria are called . only if the object passes all filtercriteria it remains in the collection . otherwise , it is removed .
