@Override
    protected void onMessage(RedissonCountDownLatchEntry value, Long message) {
        if (message.equals(ZERO_COUNT_MESSAGE)) {
            Runnable runnableToExecute = value.getListeners().poll();
            while (runnableToExecute != null) {
                runnableToExecute.run();
                runnableToExecute = value.getListeners().poll();
            }

            value.getLatch().open();
        }
        if (message.equals(NEW_COUNT_MESSAGE)) {
            value.getLatch().close();
        }
    }
@Test
  public void testOnZeroMessageAllListenersExecuted(@Mocked Runnable listener) {
    int listenCount = 10;
    RedissonCountDownLatchEntry entry = new RedissonCountDownLatchEntry(null);
    for (int i = 0; i < listenCount; i++) {
      entry.addListener(listener);
    }
    countDownLatchPubSub.onMessage(entry, CountDownLatchPubSub.ZERO_COUNT_MESSAGE);
    new Verifications() {{
      listener.run();
      times = listenCount;
    }};
  }