### Question:
ObjectToFastjsonFunction implements GetterFunction<Object, String> { @Nullable @Override public String apply(@Nullable Object input) { return input == null ? null : JSON.toJSONString(input); }  @Nullable @Override String apply(@Nullable Object input);  }### Answer:
@Test public void testApply() throws Exception { A a = new A(); List<Integer> list = Lists.newArrayList(1, 2, 3); a.setList(list); Method m = A.class.getDeclaredMethod("getList"); GetterInvoker invoker = FunctionalGetterInvoker.create("list", m); String r = (String) invoker.invoke(a); assertThat(r, is(JSON.toJSONString(list))); B b = new B(3, 5); a.setB(b); Method m2 = A.class.getDeclaredMethod("getB"); GetterInvoker invoker2 = FunctionalGetterInvoker.create("b", m2); String r2 = (String) invoker2.invoke(a); assertThat(r2, is(JSON.toJSONString(b))); }