### Question:
Sequence implements Procedure<A> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof Sequence<?>)) { return false; } Sequence<?> that = (Sequence<?>) obj; return this.list.equals(that.list); } Sequence();  Sequence(Procedure<? super A>... procedures);  Sequence(Iterable<Procedure<? super A>> procedures); Sequence<A> then(Procedure<? super A> p); void run(A obj); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void testEquals() throws Exception { Sequence<?> p = new Sequence<Object>(); assertEquals(p,p); Sequence<?> q = new Sequence<Object>(); assertObjectsAreEqual(p,q); for (int i=0;i<3;i++) { p.then(new NoOp()); assertObjectsAreNotEqual(p,q); q.then(new NoOp()); assertObjectsAreEqual(p,q); p.then(new Sequence<Object>(new NoOp(),new NoOp())); assertObjectsAreNotEqual(p,q); q.then(new Sequence<Object>(new NoOp(),new NoOp())); assertObjectsAreEqual(p,q); } assertObjectsAreNotEqual(p,new NoOp()); assertFalse(p.equals(null)); }