MessengerImpl implements Messenger, MessageProcessor { public void destroy() { messageSender.dispose(); notificationExecutor.shutdown(); }  void init(); void destroy(); void setDaoManager( final DaoManager daoManager ); @Override Message createMessage( final Object payload ); @Override void sendMessage( final Peer peer, final Message message, final String recipient, final int timeToLive,
                             final Map<String, String> headers ); @Override MessageStatus getMessageStatus( final UUID messageId ); @Override void processMessage( String envelopeString ); void addMessageListener( final MessageListener listener ); void removeMessageListener( final MessageListener listener );  }
@Test public void testDestroy() throws Exception { messenger.destroy(); verify( messageSender ).dispose(); verify( notificationExecutor ).shutdown(); }