private void waitForRefill(int maxWaitMs) {
      synchronized (refillSignalLock) {
        try {
          //noinspection WaitNotInLoop
          refillSignalLock.wait(maxWaitMs);
        }
        catch (InterruptedException ignored) {
        }
      }
    }
private void waitForRefill(int maxWaitMs)