### Question:
EnumToIntegerFunction implements GetterFunction<Enum, Integer> { @Nullable @Override public Integer apply(@Nullable Enum input) { return input == null ? null : input.ordinal(); }  @Nullable @Override Integer apply(@Nullable Enum input);  }### Answer:
@Test public void testApply() throws Exception { A a = new A(); a.setE(E.Y); Method m = A.class.getDeclaredMethod("getE"); GetterInvoker invoker = FunctionalGetterInvoker.create("e", m); Integer r = (Integer) invoker.invoke(a); assertThat(r, is(1)); }