### Question:
HttpHeaders { public void set(String name, String value) { List<String> values = headers.get(name); if (values == null) { values = new ArrayList<>(1); headers.put(name, values); } else { values.clear(); } values.add(value); } HttpHeaders(int size);  HttpHeaders(Map<String, List<String>> headers); String get(String name); List<String> getValues(String name); void set(String name, String value); void add(String name, String value); List<String> names(); Map<String, List<String>> headers(); static HttpHeaders defaultHeaders();  }### Answer:
@Test public void testSet() { HttpHeaders headers = new HttpHeaders(2); headers.set("Connection", "close"); headers.set("Connection", "Keep-Alive"); headers.set("Accept-Encoding", "gzip, deflate"); Assert.assertEquals("Keep-Alive", headers.get("Connection")); Assert.assertEquals("gzip, deflate", headers.get("Accept-Encoding")); Assert.assertEquals(Collections.singletonList("Keep-Alive"), headers.getValues("Connection")); Assert.assertEquals(Collections.singletonList("gzip, deflate"), headers.getValues("Accept-Encoding")); }