@Test
public void testSubscribe() throws Exception {

	final TestNotificationListener listener = new TestNotificationListener();
	// Unsuccessful subscription, because no outstanding requests
	assertFalse("Allowed to subscribe w/o any outstanding requests.", writer.registerAllRequestsProcessedListener(listener));
	// Successful subscription
	addRequest();
	assertTrue("Didn't allow to subscribe.", writer.registerAllRequestsProcessedListener(listener));
	// Test notification
	handleRequest();
	assertEquals("Listener was not notified.", 1, listener.getNumberOfNotifications());
}