This is part of JavaUnitTestChallengeSolved. -- DonWells ---- Our next test to add is one where we run ten separate put threads and service them with a single take thread. Our hope is to catch the puts overwhelming the single take. To do this, we first need to change T''''''akeThread so that we can specify that we want to get 50 inputs instead of the 5 we have been using all along. Let's just add an instance variable to tell us how many takes to do and make 5 the default. We can also add a ConstructorMethod which allows use to specify how many takes. int numberOfTakes; T''''''akeThread(BoundedBuffer aBuffer){ numberOfTakes = 5; buffer = aBuffer;} T''''''akeThread(BoundedBuffer aBuffer, int aNumberOfTakes){ this(aBuffer); numberOfTakes = aNumberOfTakes;} Now we can create our test: public class TenAndOne extends Test { public BoundedBuffer buffer; public P''''''utThread putThreads []; public T''''''akeThread takeThread; public void setUp(){ buffer = new BoundedBuffer(); putThreads = new P''''''utThread [10]; takeThread = new T''''''akeThread(buffer, 50); for (int each = 0; each < 10; each++) { putThreads[each] = new P''''''utThread(buffer);};} public void tearDown(){ T''''''akeThread.dumpOutput();} public void runTest (){ T''''''akeThread.resetOutput(); takeThread.start(); for (int each = 0; each < 10; each++) { putThreads[each].start();}; waitForPutToFinish(); sleepHalfSecond(); should(T''''''akeThread.outputLength() == 50, "output was too short"); should(T''''''akeThread.doesOuputHaveTenOf("a"), "should get ten a"); should(T''''''akeThread.doesOuputHaveTenOf("b"), "should get ten b"); should(T''''''akeThread.doesOuputHaveTenOf("c"), "should get ten c"); should(T''''''akeThread.doesOuputHaveTenOf("d"), "should get ten d"); should(T''''''akeThread.doesOuputHaveTenOf("e"), "should get ten e");} public void waitForPutToFinish(){ try { for (int each = 0; each < 10; each++) { putThreads[each].join(4000);}} catch (InterruptedException exception) {};} } This test runs just fine. http://members.aol.com/jdwells123/tenandonepassed.gif