docs: private synchronized ContainerStateChangeReport createContainerStateChangeReport(boolean resetHistory) {
  
          final Map<ServiceName, Set<ServiceName>> missingDeps;
          if (problems.isEmpty()) {
              missingDeps = Collections.emptyMap();
          } else {
              missingDeps =new HashMap<ServiceName, Set<ServiceName>>(problems.size());
              for (ServiceController<?> controller : problems) {
                  if (controller.getState() != ServiceController.State.REMOVED) {
                      for (ServiceName missing : controller.getUnavailableDependencies()) {
                          Set<ServiceName> dependents = missingDeps.get(missing);
                          if (dependents == null) {
                              dependents = new HashSet<ServiceName>();
                              missingDeps.put(missing, dependents);
                          }
                          dependents.add(controller.getName());
                      }
                  } // else it's no longer a problem
              }
          }
  
          final Set<ServiceName> previousMissing = previousMissingDepSet;
  
          // no longer missing deps...
          final Map<ServiceName, Boolean> noLongerMissingServices;
          if (previousMissing.isEmpty()) {
              noLongerMissingServices = Collections.emptyMap();
          } else {
              noLongerMissingServices = new TreeMap<ServiceName, Boolean>();
              for (ServiceName name : previousMissing) {
                  if (!missingDeps.containsKey(name)) {
                      ServiceController<?> controller = serviceRegistry.getService(name);
                      noLongerMissingServices.put(name, controller != null);
                  }
              }
          }
  
          // newly missing deps
          final Map<ServiceName, MissingDependencyInfo> missingServices;
          if (missingDeps.isEmpty()) {
              missingServices = Collections.emptyMap();
          } else {
              missingServices = new TreeMap<ServiceName, MissingDependencyInfo>();
              for (Map.Entry<ServiceName, Set<ServiceName>> entry : missingDeps.entrySet()) {
                  final ServiceName name = entry.getKey();
                  if (!previousMissing.contains(name)) {
                      ServiceController<?> controller = serviceRegistry.getService(name);
                      boolean unavailable = controller != null && controller.getMode() != ServiceController.Mode.NEVER;
                      missingServices.put(name, new MissingDependencyInfo(name, unavailable, entry.getValue()));
                  }
              }
          }
  
          final Set<ServiceController<?>> currentFailedControllers;
          final Set<ServiceController<?>> newFailedControllers;
          if (failed.isEmpty()) {
              currentFailedControllers = newFailedControllers = Collections.emptySet();
          } else {
              currentFailedControllers = new HashSet<>(failed.size());
              newFailedControllers = new HashSet<>(failed.size());
              for (ServiceController<?> controller : failed) {
                  if (controller.getState() != ServiceController.State.REMOVED) {
                      currentFailedControllers.add(controller);
                      if (!previousFailedSet.contains(controller)) {
                          newFailedControllers.add(controller);
                      }
                  } // else it's no longer failed since it's gone
              }
          }
  
          if (resetHistory)  {
              previousMissingDepSet = new HashSet<ServiceName>(missingDeps.keySet());
              previousFailedSet = new HashSet<>(currentFailedControllers);
              failed.clear();
              problems.clear();
          }
  
          boolean needReport = !missingServices.isEmpty() || !currentFailedControllers.isEmpty() || !noLongerMissingServices.isEmpty();
          return needReport ? new ContainerStateChangeReport(missingServices, currentFailedControllers, newFailedControllers, noLongerMissingServices) : null;
      }