ObjectLibrary { public static <T> Function<T, String> methodToString() { return new Function<T, String>() { @Override public String outputFor(T value) { return value.toString(); } }; }  static Function<T, String> methodToString(); static Function<U, T> methodIdentity(final T object); static Function<T, T> methodYourself();  }
@Test public void methodToStringReturnsString() { assertEquals("1", methodToString().outputFor(1)); assertEquals("true", methodToString().outputFor(true)); assertEquals(getClass().toString(), methodToString().outputFor(getClass())); }