### Question:
ConnectionEventPublisher extends ConnectionEventListener implements EventSource<T>, EventPublisher { @Override public void onByteWritten(long bytesWritten) { listeners.invokeListeners(bytesWrittenAction, bytesWritten); } ConnectionEventPublisher();  ConnectionEventPublisher(ConnectionEventPublisher<T> toCopy); @Override void onByteRead(final long bytesRead); @Override void onByteWritten(long bytesWritten); @Override void onFlushStart(); @Override void onFlushComplete(final long duration, final TimeUnit timeUnit); @Override void onWriteStart(); @Override void onWriteSuccess(final long duration, final TimeUnit timeUnit); @Override void onWriteFailed(final long duration, final TimeUnit timeUnit, final Throwable throwable); @Override void onConnectionCloseStart(); @Override void onConnectionCloseSuccess(final long duration, final TimeUnit timeUnit); @Override void onConnectionCloseFailed(final long duration, final TimeUnit timeUnit, final Throwable throwable); @Override void onCustomEvent(Object event); @Override void onCustomEvent(Object event, long duration, TimeUnit timeUnit); @Override void onCustomEvent(Object event, long duration, TimeUnit timeUnit, Throwable throwable); @Override void onCustomEvent(Object event, Throwable throwable); @Override Subscription subscribe(T listener); @Override boolean publishingEnabled(); ConnectionEventPublisher<T> copy();  }### Answer:
@Test(timeout = 60000) public void testOnByteWritten() throws Exception { rule.publisher.onByteWritten(1); rule.listener.assertMethodsCalled(Event.BytesWritten); assertThat("Listener not called with bytes written.", rule.listener.getBytesWritten(), is(1L)); }