public static @NotNull <T> List<T> getTargets(@NotNull AnActionEvent e, @NotNull Class<T> clazz) {
    Object[] items = e.getData(PlatformCoreDataKeys.SELECTED_ITEMS);
    if (items == null) return Collections.emptyList();

    List<T> result = new ArrayList<>();
    for (Object item : items) {
      if (!clazz.isInstance(item)) {
        return Collections.emptyList();
      }
      result.add(clazz.cast(item));
    }
    return result;
  }
public static @NotNull <T> List<T> getTargets(@NotNull AnActionEvent e, @NotNull Class<T> clazz)