Skip to content

Commit 5f45255

Browse files
davidmotenakarnokd
authored andcommitted
enhance test for groupBy with evicting map factory (#5867)
1 parent 3346ff9 commit 5f45255

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/java/io/reactivex/internal/operators/flowable/FlowableGroupByTest.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1996,7 +1996,7 @@ public V put(K key, V value) {
19961996
//remove first
19971997
K k = list.get(0);
19981998
list.remove(0);
1999-
v = map.get(k);
1999+
v = map.remove(k);
20002000
} else {
20012001
v = null;
20022002
}
@@ -2014,16 +2014,20 @@ public V put(K key, V value) {
20142014

20152015
@Override
20162016
public V remove(Object key) {
2017+
list.remove(key);
20172018
return map.remove(key);
20182019
}
20192020

20202021
@Override
20212022
public void putAll(Map<? extends K, ? extends V> m) {
2022-
map.putAll(m);
2023+
for (Entry<? extends K, ? extends V> entry: m.entrySet()) {
2024+
put(entry.getKey(), entry.getValue());
2025+
}
20232026
}
20242027

20252028
@Override
20262029
public void clear() {
2030+
list.clear();
20272031
map.clear();
20282032
}
20292033

0 commit comments

Comments
 (0)