### Question:
BinarySequence implements BinaryProcedure<L, R> { @Override public final boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof BinarySequence<?, ?>)) { return false; } BinarySequence<?, ?> that = (BinarySequence<?, ?>) obj; return this.list.equals(that.list); } BinarySequence();  BinarySequence(BinaryProcedure<? super L, ? super R>... procedures);  BinarySequence(Iterable<BinaryProcedure<? super L, ? super R>> procedures); final BinarySequence<L, R> then(BinaryProcedure<? super L, ? super R> p); final void run(L left, R right); @Override final boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@SuppressWarnings("rawtypes") @Test public void testEquals() throws Exception { BinarySequence<String, String> p = new BinarySequence<String, String>(); assertEquals(p,p); BinarySequence<String, String> q = new BinarySequence<String, String>(); 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 BinarySequence<String, String>(new NoOp(),new NoOp())); assertObjectsAreNotEqual(p,q); q.then(new BinarySequence<String, String>(new NoOp(),new NoOp())); assertObjectsAreEqual(p,q); } assertObjectsAreNotEqual(p,new NoOp()); assertObjectsAreNotEqual(p,new BinarySequence<String, String>((BinaryProcedure<String, String>[])null)); assertObjectsAreNotEqual(p,new BinarySequence<String, String>((BinaryProcedure<String, String>)null)); assertObjectsAreNotEqual(p,new BinarySequence((Iterable<BinaryProcedure>)null)); Iterable<BinaryProcedure> iterable = Arrays.<BinaryProcedure>asList( new NoOp(), new BinarySequence<String, String>(new NoOp(),new NoOp()), new NoOp(), new BinarySequence<String, String>(new NoOp(),new NoOp()), new NoOp(), new BinarySequence<String, String>(new NoOp(),new NoOp())); assertObjectsAreEqual(p,new BinarySequence(iterable)); assertTrue(!p.equals(null)); }