code: public static <T> Set<T> subset(Set<T> set, Criteria<T> criteria) {
          Set<T> subset = new HashSet<T>();
          for(T item : set) {
              if(criteria.meetsCriteria(item)) {
                  subset.add(item);
              }
          }
          return subset;
      }
docs: Create a subset using a {@code Criteria}
  @param set original set
  @param criteria criteria
  @param <T> type
  @return a new subset containing items form the original set that met the criteria