code: @Override
  	public boolean unsubscribeAllChannels() {
          final Collection<BitfinexStreamSymbol> channels = getSubscribedChannels();
          final int channelsToUnsubscribe = channels.size();
  
          logger.debug("Calling unsubscribe for {} channels", channelsToUnsubscribe);
  		final CountDownLatch countDownLatch = new CountDownLatch(channelsToUnsubscribe);
  
          try (Closeable c = callbackRegistry.onUnsubscribeChannelEvent(s -> countDownLatch.countDown())) {
              channels.forEach(symbol -> sendCommand(new UnsubscribeChannelCommand(symbol)));
  
              // Await the unsubscription
              countDownLatch.await(30, TimeUnit.SECONDS);
  
              return true;
          } catch (final InterruptedException | IOException e) {
              Thread.currentThread().interrupt();
              return false;
          }
  	}
docs: Wait for unsubscription complete