code: public static <K, V> Map<K, V> filter(Map<K, V> map, Filter<Map.Entry<K, V>> filter) {
  
      Assert.notNull(map, "Map is required");
      Assert.notNull(filter, "Filter is required");
  
      return map.entrySet().stream().filter(filter::accept)
        .collect(Collectors.toMap(Map.Entry::<K>getKey, Map.Entry::<V>getValue));
    }
docs: Returns a filtered {@link Map} containing only the key-value entries from the given {@link Map} that are accepted
  by the {@link Filter}.
  
  @param <K> Class type of the key.
  @param <V> Class type of the value.
  @param map {@link Map} to filter.
  @param filter {@link Filter} used to filter the {@link Map}.
  @return a filtered {@link Map} containing only the key-value entries from the given {@link Map} }accepted by
  the {@link Filter}.
  @throws IllegalArgumentException if either the {@link Map} or {@link Filter} are null.
  @see org.cp.elements.lang.Filter
  @see java.util.Map