@SuppressWarnings("unchecked")
  @Test
  void shouldRetrieveHeadersWithoutNull() {
    RequestTemplate template =
        new RequestTemplate()
            .header("key1", (String) null)
            .header("key2", Collections.emptyList())
            .header("key3", (Collection) null)
            .header("key4", "valid")
            .header("key5", "valid")
            .header("key6", "valid")
            .header("key7", "valid");

    assertThat(template.headers()).hasSize(4);
    assertThat(template.headers().keySet()).containsExactly("key4", "key5", "key6", "key7");
  }
Implementations have a bug if they pass junk as the http method.
core/src/test/java/feign/RequestTemplateTest.java