### Question:
ProviderWrapper implements Provider, ProviderListener { @Override public void onConnectionEstablished(URI remoteURI) { listener.onConnectionEstablished(this.next.getRemoteURI()); } ProviderWrapper(E next); @Override void connect(JmsConnectionInfo connectionInfo); @Override void start(); @Override void close(); @Override URI getRemoteURI(); @Override List<URI> getAlternateURIs(); @Override void create(JmsResource resource, AsyncResult request); @Override void start(JmsResource resource, AsyncResult request); @Override void stop(JmsResource resource, AsyncResult request); @Override void destroy(JmsResource resourceId, AsyncResult request); @Override void send(JmsOutboundMessageDispatch envelope, AsyncResult request); @Override void acknowledge(JmsSessionId sessionId, ACK_TYPE ackType, AsyncResult request); @Override void acknowledge(JmsInboundMessageDispatch envelope, ACK_TYPE ackType, AsyncResult request); @Override void commit(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request); @Override void rollback(JmsTransactionInfo transactionInfo, JmsTransactionInfo nextTransactionInfo, AsyncResult request); @Override void recover(JmsSessionId sessionId, AsyncResult request); @Override void unsubscribe(String subscription, AsyncResult request); @Override void pull(JmsConsumerId consumerId, long timeout, AsyncResult request); @Override JmsMessageFactory getMessageFactory(); @Override ProviderFuture newProviderFuture(); @Override ProviderFuture newProviderFuture(ProviderSynchronization synchronization); @Override void setProviderListener(ProviderListener listener); @Override ProviderListener getProviderListener(); @Override void onInboundMessage(JmsInboundMessageDispatch envelope); @Override void onCompletedMessageSend(JmsOutboundMessageDispatch envelope); @Override void onFailedMessageSend(JmsOutboundMessageDispatch envelope, ProviderException cause); @Override void onConnectionInterrupted(URI remoteURI); @Override void onConnectionRecovery(Provider provider); @Override void onConnectionRecovered(Provider provider); @Override void onConnectionRestored(URI remoteURI); @Override void onConnectionEstablished(URI remoteURI); @Override void onConnectionFailure(ProviderException ex); @Override void onResourceClosed(JmsResource resource, ProviderException cause); @Override void onProviderException(ProviderException cause); Provider getNext();  }### Answer:
@Test public void testOnConnectionEstablished() throws Exception { Provider mockProvider = Mockito.mock(Provider.class); ProviderWrapper<Provider> wrapper = new ProviderWrapper<Provider>(mockProvider); ProviderListener listener = Mockito.mock(ProviderListener.class); URI remoteURI = new URI("tcp: Mockito.when(mockProvider.getRemoteURI()).thenReturn(remoteURI); wrapper.setProviderListener(listener); wrapper.onConnectionEstablished(remoteURI); Mockito.verify(listener).onConnectionEstablished(remoteURI); }