1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-09 22:01:10 +01:00

Add MultiMapTest

This commit is contained in:
Paul Schaub 2018-08-21 15:27:06 +02:00
parent 5cd87bd537
commit 4a45b9d114
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 135 additions and 8 deletions

View file

@ -89,14 +89,9 @@ public class MultiMap<K, V> {
vs.remove(v);
}
public void putAll(Map<? extends K, ? extends Set<V>> _map) {
for (K key : _map.keySet()) {
Set<V> vs = this.map.get(key);
if (vs == null) {
vs = new HashSet<>();
this.map.put(key, vs);
}
vs.addAll(_map.get(key));
public void putAll(MultiMap<K, V> other) {
for (K key : other.keySet()) {
put(key, other.get(key));
}
}