code: void disconnect(boolean force) {
      synchronized (this) {
        if (force || subscriptions.isEmpty()) {
          transport.disconnect(new OperationClientMessage.Terminate());
          State disconnectionState = (state == State.STOPPING) ? State.STOPPED : State.DISCONNECTED;
          setStateAndNotify(disconnectionState);
          subscriptions = new LinkedHashMap<>();
        }
      }
    }
docs: Disconnect the web socket and update the state.  If we are stopping, set the state to
  {@link State#STOPPED} so that new subscription requests will <b>not</b> automatically re-open
  the web socket.  If we are not stopping, set the state to {@link State#DISCONNECTED} so that
  new subscription requests <b>will</b> automatically re-open the web socket.
  
  @param force if true, always disconnect web socket, regardless of the status of {@link #subscriptions}