static Entry<List<Integer>, List<String>> parseGenerateAssignmentArgs(String reassignmentJson,
                                                                           String brokerList) throws JsonMappingException {
        List<Integer> brokerListToReassign = Arrays.stream(brokerList.split(",")).map(Integer::parseInt).collect(Collectors.toList());
        Set<Integer> duplicateReassignments = ToolsUtils.duplicates(brokerListToReassign);
        if (!duplicateReassignments.isEmpty())
            throw new AdminCommandFailedException(String.format("Broker list contains duplicate entries: %s", duplicateReassignments));
        List<String> topicsToReassign = parseTopicsData(reassignmentJson);
        Set<String> duplicateTopicsToReassign = ToolsUtils.duplicates(topicsToReassign);
        if (!duplicateTopicsToReassign.isEmpty())
            throw new AdminCommandFailedException(String.format("List of topics to reassign contains duplicate entries: %s",
                duplicateTopicsToReassign));
        return new SimpleImmutableEntry<>(brokerListToReassign, topicsToReassign);
    }
Parse and validate data gathered from the command-line for --generate
In particular, we parse the JSON and validate that duplicate brokers and
topics don't appear.

@param reassignmentJson       The JSON passed to --generate .
@param brokerList             A list of brokers passed to --generate.

@return                       A tuple of brokers to reassign, topics to reassign
tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java