@Test public void shouldReturnTrueIfTheInstanceBeingEvaluatedIsOfTheClassSpecifiedAtConstruction() throws Exception { Predicate<Number> instanceOfPredicate = new InstanceOfPredicate<Number>(Integer.class); boolean result = instanceOfPredicate.evaluate(180); assertThat(result, is(true)); }
@Override public boolean evaluate(T instance) { return testClass.isInstance(instance); }
InstanceOfPredicate implements Predicate<T> { @Override public boolean evaluate(T instance) { return testClass.isInstance(instance); } }
InstanceOfPredicate implements Predicate<T> { @Override public boolean evaluate(T instance) { return testClass.isInstance(instance); } InstanceOfPredicate(Class<?> testClass); }
InstanceOfPredicate implements Predicate<T> { @Override public boolean evaluate(T instance) { return testClass.isInstance(instance); } InstanceOfPredicate(Class<?> testClass); @Override boolean evaluate(T instance); @Override boolean equals(Object other); @Override int hashCode(); }
InstanceOfPredicate implements Predicate<T> { @Override public boolean evaluate(T instance) { return testClass.isInstance(instance); } InstanceOfPredicate(Class<?> testClass); @Override boolean evaluate(T instance); @Override boolean equals(Object other); @Override int hashCode();  }