### Question:
Identity implements Function<T, T>, Predicate<T> { public T evaluate(T obj) { return obj; } Identity(); T evaluate(T obj); boolean test(Object obj); boolean test(Boolean bool); @Override boolean equals(Object that); @Override int hashCode(); @Override String toString(); static Identity<T> instance(); static final Identity<Object> INSTANCE; }### Answer:
@Test public void testEvaluate() throws Exception { Function<Object, Object> f = new Identity<Object>(); assertNull(f.evaluate(null)); assertEquals("xyzzy",f.evaluate("xyzzy")); assertEquals(Integer.valueOf(3),f.evaluate(Integer.valueOf(3))); Object obj = Long.valueOf(12345L); assertSame(obj,f.evaluate(obj)); }