public static void save(PermissionHolder holder, Sender sender, LuckPermsPlugin plugin) {
        if (holder.getType() == HolderType.USER) {
            User user = (User) holder;
            save(user, sender, plugin);
        } else if (holder.getType() == HolderType.GROUP) {
            Group group = (Group) holder;
            save(group, sender, plugin);
        } else {
            throw new IllegalArgumentException();
        }
    }
Utility methods for saving users, groups and tracks.
common/src/main/java/me/lucko/luckperms/common/command/utils/StorageAssistant.java