99100101102103104105106107108109
while (count.get() < NUMBER) { if (waitTime <= 0) { break; } else { count.wait(waitTime); waitTime = maxWaitTime - (System.currentTimeMillis() - start); } } } assertTrue("Unexpected count: " + count, count.get() == NUMBER);
979899100101102103104105106107