Map<K, V> filterEntries(bool predicate(K k, V v)) { return Map.fromEntries(entries.where((e) => predicate(e.key, e.value))); }