Listener implements Runnable { void stop() { LOGGER.debug("Requesting shutdown of consumer thread"); running = false; if (context != null) { try { context.term(); } catch (Exception e) { LOGGER.error("Could not terminate context during stop() [{}]", e); } } } Listener(ZeromqEndpoint endpoint, Processor processor, SocketFactory akkaSocketFactory, ContextFactory akkaContextFactory); @Override void run(); void setCallback(AsyncCallback callback);  }
@Test public void stopIgnoresNullContext() { listener.stop(); }