mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-09 22:01:10 +01:00
Add MultiMapTest
This commit is contained in:
parent
5cd87bd537
commit
4a45b9d114
2 changed files with 135 additions and 8 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue