### Question:
IsInstance implements BinaryPredicate<T, Class<?>> { public boolean test(T left, Class<?> right) { return right.isInstance(left); }  boolean test(T left, Class<?> right); @Override boolean equals(Object that); @Override int hashCode(); @Override String toString(); static IsInstance<T> instance(); static Predicate<T> of(Class<?> clazz); static final IsInstance<Object> INSTANCE; }### Answer:
@Test public void testTest() throws Exception { BinaryPredicate<Object, Class<?>> p = IsInstance.INSTANCE; assertFalse(p.test(null, Number.class)); assertFalse(p.test("foo", Number.class)); assertTrue(p.test(3, Number.class)); assertTrue(p.test(3L, Number.class)); }
@Test public void testInstanceOfNull() throws Exception { BinaryPredicate<Object, Class<?>> p = new IsInstance<Object>(); try { p.test("foo", null); fail("Expected NullPointerException"); } catch(NullPointerException e) { } }