@Test public void valuesCannotBeNull() { assertThrows(NullPointerException.class, () -> header("name", "value1", null, "value2")); }
public static HttpHeader header(String name, String... values) { if (values.length <= 0) { throw new IllegalArgumentException("must give at least one value"); } return new HttpHeader(requireNonNull(name), ImmutableList.copyOf(values)); }
HttpHeader { public static HttpHeader header(String name, String... values) { if (values.length <= 0) { throw new IllegalArgumentException("must give at least one value"); } return new HttpHeader(requireNonNull(name), ImmutableList.copyOf(values)); } }
HttpHeader { public static HttpHeader header(String name, String... values) { if (values.length <= 0) { throw new IllegalArgumentException("must give at least one value"); } return new HttpHeader(requireNonNull(name), ImmutableList.copyOf(values)); } private  HttpHeader(String name, List<String> values); }
HttpHeader { public static HttpHeader header(String name, String... values) { if (values.length <= 0) { throw new IllegalArgumentException("must give at least one value"); } return new HttpHeader(requireNonNull(name), ImmutableList.copyOf(values)); } private  HttpHeader(String name, List<String> values); static HttpHeader header(String name, String... values); String name(); String value(); Iterable<String> values(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString(); }
HttpHeader { public static HttpHeader header(String name, String... values) { if (values.length <= 0) { throw new IllegalArgumentException("must give at least one value"); } return new HttpHeader(requireNonNull(name), ImmutableList.copyOf(values)); } private  HttpHeader(String name, List<String> values); static HttpHeader header(String name, String... values); String name(); String value(); Iterable<String> values(); @Override int hashCode(); @Override boolean equals(Object o); @Override String toString();  }