code: public synchronized void waitForData() {
          while (this.flushers.isEmpty() && this.isNotStopped()) {
              try {
                  this.wait();
              } catch (final InterruptedException e) {
                  Thread.currentThread().interrupt();
                  throw new RuntimeException(e);
              }
          }
      }
docs: wait for the data