private static void handleDeletion(@NotNull List<RadComponent> components) throws Exception {
    // Segment the deleted components into lists of siblings
    Map<RadComponent, List<RadComponent>> siblingLists = RadComponent.groupSiblings(components);

    // Notify parent components about children getting deleted
    for (Map.Entry<RadComponent, List<RadComponent>> entry : siblingLists.entrySet()) {
      RadComponent parent = entry.getKey();
      List<RadComponent> children = entry.getValue();
      boolean finished = false;
      if (parent instanceof IComponentDeletionParticipant handler) {
        finished = handler.deleteChildren(parent, children);
      }
      else if (parent != null && /*check root*/
               parent.getLayout() instanceof IComponentDeletionParticipant handler) {
        finished = handler.deleteChildren(parent, children);
      }

      if (!finished) {
        deleteComponents(children);
      }
    }
  }
private static void handleDeletion(@NotNull List<RadComponent> components)