Returns a map containing the mappings in unfiltered whose keys satisfy a predicate. The returned map is a live view of unfiltered; changes to one affect the other. The resulting map's keySet(), entrySet(), and values() views have iterators that don't suppo
(Map<K, V> unfiltered, final Predicate<? super K> keyPredicate)
| 2280 | |
| 2281 | |
| 2282 | public static <K, V> Map<K, V> filterKeys(Map<K, V> unfiltered, final Predicate<? super K> keyPredicate) { |
| 2283 | checkNotNull(keyPredicate); |
| 2284 | Predicate<Entry<K, ?>> entryPredicate = keyPredicateOnEntries(keyPredicate); |
| 2285 | return (unfiltered instanceof AbstractFilteredMap) ? filterFiltered((AbstractFilteredMap<K, V>) unfiltered, entryPredicate) : new FilteredKeyMap<K, V>(checkNotNull(unfiltered), keyPredicate, entryPredicate); |
| 2286 | } |
| 2287 | |
| 2288 | /** |
| 2289 | * Returns a sorted map containing the mappings in {@code unfiltered} whose |
no test coverage detected