CaseInsensitiveMapWrapper { public T put(String key, T value) { return delegate.put(key.toLowerCase(), value); } CaseInsensitiveMapWrapper(Map<String, T> delegate); T get(String key); T put(String key, T value); T remove(String key);  }
@Test public void testPut() throws Exception { String someKey = "someKey"; Object someValue = mock(Object.class); Object anotherValue = mock(Object.class); when(someMap.put(someKey.toLowerCase(), someValue)).thenReturn(anotherValue); assertEquals(anotherValue, caseInsensitiveMapWrapper.put(someKey, someValue)); verify(someMap, times(1)).put(someKey.toLowerCase(), someValue); }