### Question:
HttpHeader implements Header { public void value(String value) { Assert.isNotEmpty(value, "value is required."); if (!this.multipleValuesAllowed && !this.values.isEmpty()) { throw new IllegalStateException("Header " + this.name + " does not support multiple values. " + "To change this value, please clear() it first."); } this.values.add(value); } HttpHeader(String name);  HttpHeader(String name, Collection<String> values); void value(String value); void clear(); Collection<String> values(); String name(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void canAddNewValue_WhenMultipleIsAllowed() { HttpHeader httpHeader = new HttpHeader("Accept", Collections.singletonList("application/json")); httpHeader.value("text/html"); assertThat(httpHeader).hasValues("application/json", "text/html"); }
@Test void cannotAddNewValue_WhenMultipleIsNotAllowed() { HttpHeader httpHeader = new HttpHeader("Content-Type", Collections.singletonList("application/json")); assertThrows(IllegalStateException.class, () -> httpHeader.value("text/html")); }