@Test
public void testRegisterListener() throws Exception {

	final PipelinedSubpartition subpartition = createSubpartition();
	final TestNotificationListener listener = new TestNotificationListener();
	// Register a listener
	assertTrue(subpartition.registerListener(listener));
	// Try to register another listener
	try {
		subpartition.registerListener(listener);
		fail("Did not throw expected exception after duplicate listener registration.");
	}
	catch (IllegalStateException expected) {
	}
}