BufferedSender implements Sender { @Override public void close() throws IOException { this.executorService.shutdown(); this.sender.close(); } BufferedSender(Builder builder);   BufferedSender(Builder builder, ScheduledExecutorService executorService); Queue<Payload> queue(); Sender sender(); @Override void send(Payload payload); @Override void addListener(SenderListener listener); @Override List<SenderListener> getListeners(); @Override void close(); @Override void close(boolean wait);  }
@Test public void shouldClose() throws Exception { sut.close(); verify(executorService).shutdown(); verify(sender).close(); }