### Question:
TruePredicate implements Predicate<T> { @Override public boolean equals(Object other) { return EqualsBuilder.reflectionEquals(this, other); }  @Override boolean evaluate(T item); @Override boolean equals(Object other); @Override int hashCode();  }### Answer:
@Test public void shouldBeEqualIfOtherPredicateIsAlsoATruePredicate() throws Exception { Predicate<Object> firstPredicate = new TruePredicate<Object>(); Predicate<Object> secondPredicate = new TruePredicate<Object>(); boolean equal = firstPredicate.equals(secondPredicate); assertThat(equal, is(true)); }
@Test public void shouldBeEqualIfOtherPredicateIsATruePredicateButTypesAreDifferent() throws Exception { Predicate<String> firstPredicate = new TruePredicate<String>(); Predicate<Integer> secondPredicate = new TruePredicate<Integer>(); boolean equal = firstPredicate.equals(secondPredicate); assertThat(equal, is(true)); }
@Test public void shouldNotBeEqualIfOtherPredicateIsNotATruePredicate() throws Exception { Predicate<Object> firstPredicate = new TruePredicate<Object>(); Predicate<Object> secondPredicate = new FalsePredicate<Object>(); boolean equal = firstPredicate.equals(secondPredicate); assertThat(equal, is(false)); }