code: @SuppressWarnings("unchecked")
    public static <T> Collection<T> filter(Collection<T>  collection, Filter<T> filter) {
  
      Assert.notNull(collection, "Collection is required");
      Assert.notNull(filter, "Filter is required");
  
      return collection.stream().filter(filter::accept).collect(Collectors.toList());
    }
docs: Returns a filtered {@link Collection} containing only the elements from the given {@link Collection} accepted by
  the {@link Filter}.
  
  @param <T> Class type of the elements in the {@link Collection}.
  @param collection {@link Collection} to filter.
  @param filter {@link Filter} used to filter the {@link Collection}.
  @return a filtered {@link Collection} of elements accepted by the {@link Filter}.
  @throws IllegalArgumentException if either the {@link Collection} or {@link Filter} are null.
  @see org.cp.elements.lang.Filter