### Question:
CompleteChannelFuture implements ChannelFuture { public void addListener(ChannelFutureListener listener) { try { listener.operationComplete(this); } catch (Throwable t) { if (logger.isWarnEnabled()) { logger.warn( "An exception was thrown by " + ChannelFutureListener.class.getSimpleName() + '.', t); } } } protected  CompleteChannelFuture(Channel channel); void addListener(ChannelFutureListener listener); void removeListener(ChannelFutureListener listener); ChannelFuture await(); boolean await(long timeout, TimeUnit unit); boolean await(long timeoutMillis); ChannelFuture awaitUninterruptibly(); boolean awaitUninterruptibly(long timeout, TimeUnit unit); boolean awaitUninterruptibly(long timeoutMillis); Channel getChannel(); boolean isDone(); boolean setProgress(long amount, long current, long total); boolean setFailure(Throwable cause); boolean setSuccess(); boolean cancel(); boolean isCancelled();  }### Answer:
@Test public void shouldNotifyImmediatelyOnAdd() throws Exception { ChannelFutureListener l = createStrictMock(ChannelFutureListener.class); l.operationComplete(future); replay(l); future.addListener(l); verify(l); }
@Test public void shouldNotRethrowListenerException() { ChannelFutureListener l = new ChannelFutureListener() { public void operationComplete(ChannelFuture future) throws Exception { throw new ExpectedError(); } }; future.addListener(l); }