@Test
	public void testSingleWriterManyReads()
	{
		final int MESSAGES = 10000;
		final int READERS = 10;
		final int MESSAGES_PER_READER = MESSAGES / READERS;

		final AtomicInteger nullCounter = new AtomicInteger();
		final BlockableQueue<Integer> q = new BlockableQueue<Integer>();
		q.setBlocking(true);
		
		Runnable reader = new Runnable() {
			public void run() {
				int total = 0;
				double minWait = Double.MAX_VALUE;
				double maxWait = -Double.MAX_VALUE;
				Stopwatch watch = new Stopwatch();
				while (total < MESSAGES_PER_READER) {
					watch.start();
					Integer value = q.poll();
					watch.stop();
					if (value != null) {
						minWait = Math.min(minWait, watch.seconds());
						maxWait = Math.max(maxWait, watch.seconds());
						total++;	
					} else {
						nullCounter.incrementAndGet();
					}
				}
				System.out.format("Wait: min[%.6fs] max[%.6fs]\n", minWait, maxWait);
			}
		};
		
		Runnable writer = new Runnable() {
			public void run() {
				for (int i = 0; i < MESSAGES; i++) {
					assertTrue( q.offer(i) );
				}
			}
		};
		
		GroupTask.initialize(READERS + 1);
		GroupTask.add(reader, READERS);
		GroupTask.add(writer);
		GroupTask.execute();
		
		System.out.println("Null polls: " + nullCounter.get());
	}