docs: public synchronized void checkState(State requiredState) throws IllegalStateException {
          if (requiredState != currentState) {
              throw new IllegalStateException(String.format(Locale.US,
                      "Expected state %s, but in state %s", requiredState, currentState));
          }
      }