public static <K, V> Map<K, V> select_keys_pred(Set<K> filter, Map<K, V> all) {
        Map<K, V> filterMap = new HashMap<>();

        for (Entry<K, V> entry : all.entrySet()) {
            if (!filter.contains(entry.getKey())) {
                filterMap.put(entry.getKey(), entry.getValue());
            }
        }

        return filterMap;
    }
public static < K , V > Map < K , V > select_keys_pred ( Set < K > filter , Map < K , V > all ) { Map < K , V > filterMap = new HashMap < > ( ) ; for ( Entry < K , V > entry : all . entrySet ( ) ) { if ( ! filter . contains ( entry . getKey ( ) ) ) { filterMap . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } return filterMap ; }
filter the map