code: public static <T> long count(T[] array, Filter<T> filter) {
  
      Assert.notNull(filter, "Filter is required");
  
      return stream(nullSafeArray(array)).filter(filter::accept).count();
    }
docs: Counts the number of elements in the array matching the criteria (rules) defined by the {@link Filter}.
  
  @param <T> Class type of the elements in the array.
  @param array array to search.
  @param filter {@link Filter} used to match elements in the array and tally the count.
  @return an integer value indicating the number of elements in the array matching the criteria (rules)
  defined by the {@link Filter}.
  @throws IllegalArgumentException if {@link Filter} is null.
  @see org.cp.elements.lang.Filter