code: public static <K, V> long count(Map<K, V> map, Filter<Map.Entry<K, V>> filter) {
  
      Assert.notNull(filter, "Filter is required");
  
      return nullSafeMap(map).entrySet().stream().filter(filter::accept).count();
    }
docs: Counts the number of entries (key-value pairs) in the {@link Map} accepted by the {@link Filter}.
  
  @param <K> Class type of the key.
  @param <V> Class type of the value.
  @param map {@link Map} to evaluate.
  @param filter {@link Filter} used to determine the number of entries in the {@link Map} accepted by
  the {@link Filter}.
  @return an integer value indicating the number of entries in the {@link Map} accepted by the {@link Filter}.
  @throws IllegalArgumentException if {@link Filter} is null.
  @see org.cp.elements.lang.Filter
  @see java.util.Map