code: private boolean possiblyStopAndRemoveSupervisorInternal(String id, boolean writeTombstone)
    {
      Pair<Supervisor, SupervisorSpec> pair = supervisors.get(id);
      if (pair == null) {
        return false;
      }
  
      if (writeTombstone) {
        metadataSupervisorManager.insert(
            id,
            new NoopSupervisorSpec(null, pair.rhs.getDataSources())
        ); // where NoopSupervisorSpec is a tombstone
      }
      pair.lhs.stop(true);
      supervisors.remove(id);
  
      return true;
    }
docs: Stops a supervisor with a given id and then removes it from the list.
  <p/>
  Caller should have acquired [lock] before invoking this method to avoid contention with other threads that may be
  starting, stopping, suspending and resuming supervisors.
  
  @return true if a supervisor was stopped, false if there was no supervisor with this id