CheramiConsumerImpl implements CheramiConsumer, Reconfigurable { @Override public synchronized void close() { if (isOpen.getAndSet(false)) { connectionManager.close(); deliveryRunnable.stop(); cleanup(); } logger.info("Consumer closed"); } CheramiConsumerImpl(CheramiClient client, String dstPath, String consumerGroupName, ConsumerOptions options,
            MetricsReporter metricsReporter); @Override synchronized void open(); @Override synchronized void close(); @Override CheramiDelivery read(); @Override CheramiFuture<CheramiDelivery> readAsync(); @Override void ackDelivery(String deliveryToken); @Override void nackDelivery(String deliveryToken); boolean isOpen(); @Override void refreshNow();  }
@Test public void closeTest() throws Exception { if (!consumer.isOpen()) { consumer.open(); } assert (consumer.isOpen() == true); consumer.close(); assert (consumer.isOpen() == false); logger.info("CheramiConsumerImplTest: PASSED: CloseTest"); }