Fix test: compute if present is a put.

This commit is contained in:
Gary Gregory 2024-10-03 09:17:58 -04:00
parent 25ea554df8
commit 65ce14b757
1 changed files with 2 additions and 6 deletions

View File

@ -1622,13 +1622,9 @@ public abstract class AbstractMapTest<M extends Map<K, V>, K, V> extends Abstrac
}
}
} else if (isPutChangeSupported()) {
// compute if present is a put.
resetEmpty();
try {
getMap().computeIfPresent(keys[0], (k, v) -> values[0]);
fail("Expected UnsupportedOperationException or IllegalArgumentException on putIfAbsent (add) when fixed size");
} catch (final IllegalArgumentException | UnsupportedOperationException ex) {
// ignore
}
resetFull();
int i = 0;
for (final Iterator<K> it = getMap().keySet().iterator(); it.hasNext() && i < newValues.length; i++) {