Map<K, V> where(bool Function(K key, V value) test) { final Map<K, V> matches = {}; entries.forEach((entry) { if (test(entry.key, entry.value)) matches[entry.key] = entry.value; }); return matches; }