docs: public synchronized void storeChannelInWallet(@Nullable PaymentChannelServer connectedHandler) {
          stateMachine.checkState(State.READY);
          if (storedServerChannel != null)
              return;
  
          log.info("Storing state with contract hash {}.", getContract().getTxId());
          StoredPaymentChannelServerStates channels = (StoredPaymentChannelServerStates)
                  wallet.addOrGetExistingExtension(new StoredPaymentChannelServerStates(wallet, broadcaster));
          storedServerChannel = new StoredServerChannel(this, getMajorVersion(), getContract(), getClientOutput(), getExpiryTime(), serverKey, getClientKey(), bestValueToMe, bestValueSignature);
          if (connectedHandler != null)
              checkState(storedServerChannel.setConnectedHandler(connectedHandler, false) == connectedHandler);
          channels.putChannel(storedServerChannel);
      }