@Override public LinkedHashMap<K, V> removeAll(Iterable<? extends K> keys) { Objects.requireNonNull(keys, "keys is null"); final HashSet<K> toRemove = HashSet.ofAll(keys); final Queue<Tuple2<K, V>> newList = list.filter(t -> !toRemove.contains(t._1)); final HashMap<K, V> newMap = map.filter(t -> !toRemove.contains(t._1)); return newList.size() == size() ? this : wrap(newList, newMap); }
@Override public LinkedHashMap<K, V> removeAll(Iterable<? extends K> keys) { Objects.requireNonNull(keys, "keys is null"); final HashSet<K> toRemove = HashSet.ofAll(keys); final Queue<Tuple2<K, V>> newList = list.filter(t -> !toRemove.contains(t._1)); final HashMap<K, V> newMap = map.filter(t -> !toRemove.contains(t._1)); return newList.size() == size() ? this : wrap(newList, newMap); }