### Question:
IntegerToEnumFunction implements RuntimeSetterFunction<Integer, Enum> { @Nullable @Override public Enum apply(@Nullable Integer input, Type runtimeOutputType) { if (input == null) { return null; } Class<?> rawType = TypeToken.of(runtimeOutputType).getRawType(); EnumSet<?> es = cache.get(rawType); for (Enum<?> e : es) { if (e.ordinal() == input) { return e; } } throw new IllegalStateException("cant' trans Integer(" + input + ") to " + runtimeOutputType); }  @Nullable @Override Enum apply(@Nullable Integer input, Type runtimeOutputType);  }### Answer:
@Test public void testApply() throws Exception { A a = new A(); Method m = A.class.getDeclaredMethod("setE", E.class); SetterInvoker invoker = FunctionalSetterInvoker.create("e", m); invoker.invoke(a, 2); assertThat(a.getE(), is(E.Z)); Method m2 = A.class.getDeclaredMethod("setE2", E2.class); SetterInvoker invoker2 = FunctionalSetterInvoker.create("e2", m2); invoker2.invoke(a, 2); assertThat(a.getE2(), is(E2.C)); }