code: private synchronized void initializeListOfPreviousContainers() {
      if (this.previousContainers == null) {
        final List<Container> yarnPrevContainers =
            this.registration.getRegistration().getContainersFromPreviousAttempts();
  
        // If it's still null, create an empty list to indicate that it's not a restart.
        if (yarnPrevContainers == null) {
          this.previousContainers = Collections.unmodifiableSet(new HashSet<Container>());
        } else {
          this.previousContainers = Collections.unmodifiableSet(new HashSet<>(yarnPrevContainers));
        }
  
        yarnContainerManager.onContainersRecovered(this.previousContainers);
      }
    }
docs: Initializes the list of previous containers as reported by YARN.