RedisSubscribeThread extends Thread { public void close() throws IOException { logger.info("stopping redis subscribe thread, channel={}", channel); stop = true; RedisConnection connection = this.connection; if (connection != null) { connection.writeCommand(Protocol.Command.QUIT); } interrupt(); } RedisSubscribeThread(String name, RedisImpl redis, RedisChannelListener listener, String channel); @Override void run(); void close();  }
@Test void close() throws IOException { thread.close(); }