assertSame(future, listener2.notifiedFuture);
}
@Test
public void testRemoveListener2() throws Exception {
DefaultCloseFuture future = new DefaultCloseFuture(null);
assertFalse(future.isDone());
assertFalse(future.isClosed());
TestListener listener1 = new TestListener();
TestListener listener2 = new TestListener();
future.addListener(listener1);
future.addListener(listener2);
future.removeListener(listener2);
TestThread thread = new TestThread(future);
thread.start();
future.setClosed();
thread.join();
assertTrue(thread.success);
assertTrue(future.isDone());
assertTrue(future.isClosed());
assertSame(future, listener1.notifiedFuture);
assertSame(null, listener2.notifiedFuture);
}