MCPcopy Create free account
hub / github.com/ReadyTalk/avian / testValues

Method testValues

test/Collections.java:12–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 }
11
12 @SuppressWarnings("rawtypes")
13 private static void testValues() {
14 Map testMap = java.util.Collections.unmodifiableMap(java.util.Collections.emptyMap());
15 Collection values = testMap.values();
16
17 if (values == null) {
18 throw new NullPointerException();
19 }
20
21 try {
22 values.clear();
23
24 throw new IllegalStateException("Object should be immutable, exception should have thrown");
25 } catch (Exception e) {
26 // expected
27 }
28 }
29
30 private static void expect(boolean v) {
31 if (! v) throw new RuntimeException();

Callers 1

mainMethod · 0.95

Calls 4

valuesMethod · 0.95
clearMethod · 0.95
unmodifiableMapMethod · 0.80
emptyMapMethod · 0.80

Tested by

no test coverage detected