### Question:
AbstractMaybeAsyncHandlerBridge implements AsyncHandler<Void> { @Override public final Void onCompleted() { if (delegateTerminated.getAndSet(true)) { return null; } final T result; try { result = delegate().onCompleted(); } catch (final Throwable t) { emitOnError(t); return null; } if (!emitter.isDisposed()) { if (result == null) { emitter.onComplete(); } else { emitter.onSuccess(result); } } return null; } protected  AbstractMaybeAsyncHandlerBridge(MaybeEmitter<T> emitter); @Override final State onBodyPartReceived(HttpResponseBodyPart content); @Override final State onStatusReceived(HttpResponseStatus status); @Override final State onHeadersReceived(HttpHeaders headers); @Override State onTrailingHeadersReceived(HttpHeaders headers); @Override final Void onCompleted(); @Override final void onThrowable(Throwable t); @Override void onHostnameResolutionAttempt(String name); @Override void onHostnameResolutionSuccess(String name, List<InetSocketAddress> addresses); @Override void onHostnameResolutionFailure(String name, Throwable cause); @Override void onTcpConnectAttempt(InetSocketAddress remoteAddress); @Override void onTcpConnectSuccess(InetSocketAddress remoteAddress, Channel connection); @Override void onTcpConnectFailure(InetSocketAddress remoteAddress, Throwable cause); @Override void onTlsHandshakeAttempt(); @Override void onTlsHandshakeSuccess(SSLSession sslSession); @Override void onTlsHandshakeFailure(Throwable cause); @Override void onConnectionPoolAttempt(); @Override void onConnectionPooled(Channel connection); @Override void onConnectionOffer(Channel connection); @Override void onRequestSend(NettyRequest request); @Override void onRetry();  }### Answer:
@Test public void wontCallOnCompleteTwice() { InOrder inOrder = Mockito.inOrder(emitter); underTest.onCompleted(); inOrder.verify(emitter).onComplete(); underTest.onCompleted(); inOrder.verify(emitter, never()).onComplete(); }
@Test public void wontCallOnCompleteAfterDisposal() { given(emitter.isDisposed()).willReturn(true); underTest.onCompleted(); verify(emitter, never()).onComplete(); }
@Test public void handlesExceptionsWhileCompleting() throws Exception { final Throwable x = new RuntimeException("mocked error in delegate onCompleted()"); given(delegate.onCompleted()).willThrow(x); underTest.onCompleted(); then(emitter).should().onError(x); }