private static void deleteComponents(List<RadComponent> components) throws Exception {
    if (components.get(0) instanceof IGroupDeleteComponent component) {
      component.delete(components);
    }
    else {
      for (RadComponent component : components) {
        component.delete();
      }
    }
  }
private static void deleteComponents(List<RadComponent> components)