CacheableHttpServletResponseHeaders implements Serializable { @SuppressWarnings("unchecked") Map<String, Object> getHeaders() { Map<String, Object> original = new HashMap<String, Object>(); for (Map.Entry<String, String> entry : headers.entrySet()) { String key = entry.getKey(); int hashIndex = key.indexOf('#'); if (hashIndex > 0) key = key.substring(0, hashIndex); if (original.containsKey(key)) { Object value = original.get(key); if (value instanceof List) { ((List<String>) value).add(entry.getValue()); } else { List<String> values = new ArrayList<String>(); values.add((String)value); values.add(entry.getValue()); value = values; } original.put(key, value); } else { original.put(key, entry.getValue()); } } return original; }  int size();  }
@Test public void testGetHeaders() { assertTrue(headers.containsHeader(headerName)); assertTrue(headers.getHeaders().get(headerName) instanceof String); }