@Test
  void lastTypeFromAnonymous() throws Exception {
    Parameterized<?> instance = new Parameterized<Reader>() {};
    Type last = resolveLastTypeParameter(instance.getClass(), Parameterized.class);
    assertThat(last).isEqualTo(Reader.class);
  }
Ex. your {@code Foo} object would be null, but so would things like Number.
core/src/test/java/feign/UtilTest.java