### Question:
And extends BasePredicateList<A> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof And<?>)) { return false; } And<?> that = (And<?>) obj; return getPredicateListEquals(that); } And();  And(Iterable<Predicate<? super A>> predicates);  And(Predicate<? super A>... predicates); And<A> and(Predicate<? super A> p); boolean test(A obj); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@SuppressWarnings("rawtypes") @Test public void testEquals() throws Exception { And<Object> p = new And<Object>(); assertEquals(p,p); And<Object> q = new And<Object>(); assertObjectsAreEqual(p,q); for (int i=0;i<3;i++) { p.and(Constant.truePredicate()); assertObjectsAreNotEqual(p,q); q.and(Constant.truePredicate()); assertObjectsAreEqual(p,q); p.and(new And<Object>(Constant.truePredicate(),Constant.falsePredicate())); assertObjectsAreNotEqual(p,q); q.and(new And<Object>(Constant.truePredicate(),Constant.falsePredicate())); assertObjectsAreEqual(p,q); } assertObjectsAreNotEqual(p,Constant.truePredicate()); And<Object> r = new And<Object>(); r.and(Constant.truePredicate()); r.and(new And<Object>(Constant.truePredicate(),Constant.falsePredicate())); assertObjectsAreEqual(r, new And<Object>(r.getPredicateList())); assertObjectsAreNotEqual(p, new And((Iterable<Predicate<Object>>)null)); assertObjectsAreNotEqual(p, new And((Predicate<Object>[])null)); assertObjectsAreNotEqual(p, new And((Predicate<Object>)null)); assertTrue(!p.equals(null)); }