public static HeaderTemplate create(String name, Iterable<String> values) {
    if (name == null || name.isEmpty()) {
      throw new IllegalArgumentException("name is required.");
    }

    if (values == null) {
      throw new IllegalArgumentException("values are required");
    }

    return new HeaderTemplate(name, values, Util.UTF_8);
  }
@Test
  void it_should_throw_exception_when_name_is_empty() {
    IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
        () -> HeaderTemplate.create("", Collections.singletonList("test")));
    assertThat(exception.getMessage()).isEqualTo("name is required.");
  }