public static WebEditorRequest generate(List<PermissionHolder> holders, List<Track> tracks, Sender sender, String cmdLabel, LuckPermsPlugin plugin) {
        Preconditions.checkArgument(!holders.isEmpty(), "holders is empty");

        ImmutableContextSet.Builder potentialContexts = new ImmutableContextSetImpl.BuilderImpl();
        potentialContexts.addAll(plugin.getContextManager().getPotentialContexts());
        for (PermissionHolder holder : holders) {
            holder.normalData().forEach(node -> potentialContexts.addAll(node.getContexts()));
        }

        // form the payload data
        Map<PermissionHolder, List<Node>> holdersMap = holders.stream().collect(ImmutableCollectors.toMap(
                Function.identity(),
                holder -> holder.normalData().asList()
        ));

        Map<Track, List<String>> tracksMap = tracks.stream().collect(ImmutableCollectors.toMap(
                Function.identity(),
                Track::getGroups
        ));

        JsonObject json = createJsonPayload(holdersMap, tracksMap, sender, cmdLabel, potentialContexts.build(), plugin).toJson();
        return new WebEditorRequest(json, holdersMap, tracksMap);
    }
Generates a web editor request payload.

@param holders the holders to edit
@param tracks the tracks to edit
@param sender the sender who is creating the session
@param cmdLabel the command label used by LuckPerms
@param plugin the plugin
@return a payload
common/src/main/java/me/lucko/luckperms/common/webeditor/WebEditorRequest.java