mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
Added a simple test to show the original issue
This commit is contained in:
parent
bfe7b9110a
commit
2e921b803d
26
test/Collections.java
Normal file
26
test/Collections.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class Collections {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
testValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
|
private static void testValues() {
|
||||||
|
Map testMap = java.util.Collections.unmodifiableMap(java.util.Collections.emptyMap());
|
||||||
|
Collection values = testMap.values();
|
||||||
|
|
||||||
|
if (values == null) {
|
||||||
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
values.clear();
|
||||||
|
|
||||||
|
throw new IllegalStateException("Object should be immutable, exception should have thrown");
|
||||||
|
} catch (Exception e) {
|
||||||
|
// expected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user