code: public static <T> Collection<T> apply(Filter<T> filter, Collection<T> elements) {
  		Collection<T> result = new ArrayList<T>();
  		if(elements != null) {
  			for(T element : elements) {
  				logger.trace("analysing element '{}'...", element);
  				if(filter.matches(element)) {
  					logger.trace("... element '{}' matches", element);
  					result.add(element);
  				} else {
  					logger.trace("... element '{}' skipped", element);
  				}
  			}
  		}
  		return result;
  	}
docs: Applies the given filter to the input and returns only those elements
  that match it.
  
  @param filter
  a (possible compound) filter; elements in the input array matching the
  filter will be returned.
  @param elements
  the collection of objects to filter.
  @return
  a filtered set of elements.