code: public boolean isUnsubscribed(int restartableId) {
          Subscription subscription = restartableSubscriptions.get(restartableId);
          return subscription == null || subscription.isUnsubscribed();
      }
docs: Checks if a restartable is unsubscribed.
  
  @param restartableId id of the restartable.
  @return true if the subscription is null or unsubscribed, false otherwise.