()
| 292 | } |
| 293 | |
| 294 | @Test |
| 295 | void copyIsUnmodifiable() { |
| 296 | // Arrange |
| 297 | Map<String, Collection<String>> sourceMap = new HashMap<>(); |
| 298 | |
| 299 | sourceMap.put("First", Arrays.asList("abc", "qwerty", "xyz")); |
| 300 | sourceMap.put("camelCase", Collections.singleton("123")); |
| 301 | // Act |
| 302 | Map<String, Collection<String>> unmodifiableMap = caseInsensitiveCopyOf(sourceMap); |
| 303 | // Assert result |
| 304 | assertThatThrownBy(() -> unmodifiableMap.put("new", Collections.singleton("223322"))) |
| 305 | .isInstanceOf(UnsupportedOperationException.class); |
| 306 | assertThatThrownBy(() -> unmodifiableMap.get("camelCase").clear()) |
| 307 | .isInstanceOf(UnsupportedOperationException.class); |
| 308 | } |
| 309 | |
| 310 | @Test |
| 311 | void nullMap() { |
nothing calls this directly
no test coverage detected