void (int count) { synchronized(myOrder) { String order = printOrder(); if (count != myOrder.size()) { TestCase.fail(order + "Expected " + count + " items but was " + myOrder.size()); } for (int i = 1; i <= count; i++) if (!String.valueOf(i).equals(myOrder.get(i - 1))) { //System.out.println("Count: " + count); TestCase.fail(order + "Bad order"); } } }