()
| 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(); |
no test coverage detected