@PrepareForTest({LoggerFactory.class, RestClientFactory.class, RequestSignerImpl.class})

@Test
public void ignoreCaseHeaders_whenDuplicateHeaderKeysExists() throws Exception {
    final Map<String, List<String>> headers = new HashMap<>();
    headers.put("content-length", Collections.singletonList("238"));
    headers.put("opc-request-id", Lists.newArrayList("ID1", "ID2"));
    final Map<String, List<String>> actual = RequestSignerImpl.ignoreCaseHeaders(headers);
    assertNotNull("Map should not be null", actual);
    assertEquals("Map should contain 2 entries", 2, actual.size());
    for (Map.Entry<String, List<String>> expectedEntry : headers.entrySet()) {
        final String expectedKey = expectedEntry.getKey();
        final List<String> expectedValue = expectedEntry.getValue();
        assertTrue(
                "Actual map should contain matching key for lower case value",
                actual.containsKey(expectedKey.toLowerCase()));
        final List<String> actualValue = actual.get(expectedKey.toLowerCase());
        assertEquals(
                "Values should be equal for key: " + expectedKey, expectedValue, actualValue);
    }
}