code: public List<T> apply(Predicate<T> predicate, List<T> candidates)
      {
          List<T> filtered = new ArrayList<T>(candidates.size());
  
          for(T entity : candidates)
          {
              if(predicate.appliesTo(entity))
                  filtered.add(entity);
          }
  
          return filtered;
      }
docs: Filter a list of entities through a predicate.
  If the the predicate applies the entity will be included.
  
  @param predicate
  @param candidates
  @return a subset of the actual list of candidates