### Question:
BinarySequence implements BinaryProcedure<L, R> { public final void run(L left, R right) { for (Iterator<BinaryProcedure<? super L, ? super R>> iter = list.iterator(); iter.hasNext();) { iter.next().run(left, right); } } 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 testRunZero() throws Exception { BinarySequence<String, String> seq = new BinarySequence<String, String>(); seq.run(null,null); seq.run("xyzzy","xyzzy"); }
@Test public void testRunOne() throws Exception { RunCounter counter = new RunCounter(); BinarySequence<String, String> seq = new BinarySequence<String, String>(counter); assertEquals(0,counter.count); seq.run(null,null); assertEquals(1,counter.count); seq.run("xyzzy","xyzzy"); assertEquals(2,counter.count); }
@Test public void testRunTwo() throws Exception { RunCounter[] counter = { new RunCounter(), new RunCounter() }; BinarySequence<String, String> seq = new BinarySequence<String, String>(counter[0],counter[1]); assertEquals(0,counter[0].count); assertEquals(0,counter[1].count); seq.run(null,null); assertEquals(1,counter[0].count); assertEquals(1,counter[1].count); seq.run("xyzzy","xyzzy"); assertEquals(2,counter[0].count); assertEquals(2,counter[1].count); }