@Test
  void bodyTypeCorrespondsWithParameterType() throws Exception {
    server.enqueue(new MockResponse().setBody("foo"));

    final AtomicReference<Type> encodedType = new AtomicReference<>();
    TestInterface api =
        new TestInterfaceBuilder()
            .encoder(
                new Encoder.Default() {
                  @Override
                  public void encode(Object object, Type bodyType, RequestTemplate template) {
                    encodedType.set(bodyType);
                  }
                })
            .target("http://localhost:" + server.getPort());

    api.body(Arrays.asList("netflix", "denominator", "password"));

    server.takeRequest();

    assertThat(encodedType.get()).isEqualTo(new TypeToken<List<String>>() {}.getType());
  }
The type of a parameter value may not be the desired type to encode as. Prefer the interface
type.
core/src/test/java/feign/FeignTest.java