use of com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_KEYS in project guava by google.
the class MapComputeIfPresentTester method testComputeIfPresent_nullKeySupportedAbsent.
@MapFeature.Require({ SUPPORTS_PUT, ALLOWS_NULL_KEYS })
public void testComputeIfPresent_nullKeySupportedAbsent() {
assertNull("computeIfPresent(null, function) should return null", getMap().computeIfPresent(null, (k, v) -> {
throw new AssertionFailedError();
}));
expectUnchanged();
}
use of com.google.common.collect.testing.features.MapFeature.ALLOWS_NULL_KEYS in project guava by google.
the class MapMergeTester method testMergeAbsentNullKey.
@MapFeature.Require({ SUPPORTS_PUT, ALLOWS_NULL_KEYS })
public void testMergeAbsentNullKey() {
assertEquals("Map.merge(null, value, function) should return value", v3(), getMap().merge(null, v3(), (oldV, newV) -> {
throw new AssertionFailedError("Should not call merge function if key was absent");
}));
expectAdded(entry(null, v3()));
}
Aggregations