### Question:
BinarySequence implements BinaryProcedure<L, R> { public final BinarySequence<L, R> then(BinaryProcedure<? super L, ? super R> p) { list.add(p); return this; } 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:
@Test public void testThen() throws Exception { List<RunCounter> list = new ArrayList<RunCounter>(); BinarySequence<String, String> seq = new BinarySequence<String, String>(); seq.run(null,null); for (int i=0;i<10;i++) { RunCounter counter = new RunCounter(); seq.then(counter); list.add(counter); seq.run("xyzzy","xyzzy"); for (int j=0;j<list.size();j++) { assertEquals(list.size()-j,(((RunCounter)(list.get(j))).count)); } } }