docs: protected boolean prepareClose() {
          synchronized (lock) {
              final State state = this.state;
              if (state == State.OPEN) {
                  this.state = State.CLOSING;
                  lock.notifyAll();
                  return true;
              }
          }
          return false;
      }