code: @SuppressWarnings("unchecked")
      public final Collection<T> filter(final Collection<T> c) {
          if (getRules() != null && getRules().length > 0) {
              // attempt to use the same concrete collection type
              // as is passed in..
              Collection<T> filtered;
              try {
                  filtered = c.getClass().newInstance();
              } catch (InstantiationException | IllegalAccessException e) {
                  filtered = new ArrayList<T>();
              }
  
              if (type == MATCH_ALL) {
                  filtered.addAll(matchAll(c));
              } else {
                  filtered.addAll(matchAny(c));
              }
              return filtered;
          }
          return c;
      }
docs: Filter the given collection into a new collection.
  
  @param c a collection to filter
  @return a filtered collection