code: public void deleteNonRootComponentsInView(DbSession dbSession, Collection<ComponentDto> components) {
      Set<ComponentDto> nonRootComponents = components.stream().filter(PurgeDao::isNotRoot).collect(MoreCollectors.toSet());
      if (nonRootComponents.isEmpty()) {
        return;
      }
  
      PurgeProfiler profiler = new PurgeProfiler();
      PurgeCommands purgeCommands = new PurgeCommands(dbSession, profiler);
      deleteNonRootComponentsInView(nonRootComponents, purgeCommands);
    }
docs: Delete the non root components (ie. sub-view, application or project copy) from the specified collection of {@link ComponentDto}
  and data from their child tables.
  <p>
  This method has no effect when passed an empty collection or only root components.
  </p>