code: void stopIfNecessary() {
      synchronized (lock) {
        if (goAway && !stopped && streams.size() == 0) {
          stopped = true;
        } else {
          return;
        }
      }
      listener.transportTerminated();
    }
docs: When the transport is in goAway state, we should stop it once all active streams finish.