static Map<Integer, List<Integer>> parseReplicaAssignment(String replicaAssignmentList) {
        String[] partitionList = replicaAssignmentList.split(",");
        Map<Integer, List<Integer>> ret = new LinkedHashMap<>();
        for (int i = 0; i < partitionList.length; i++) {
            List<Integer> brokerList = Arrays.stream(partitionList[i].split(":"))
                .map(String::trim)
                .mapToInt(Integer::parseInt)
                .boxed()
                .collect(Collectors.toList());
            Collection<Integer> duplicateBrokers = ToolsUtils.duplicates(brokerList);
            if (!duplicateBrokers.isEmpty()) {
                throw new AdminCommandFailedException("Partition replica lists may not contain duplicate entries: " +
                    duplicateBrokers.stream()
                        .map(Object::toString)
                        .collect(Collectors.joining(","))
                );
            }
            ret.put(i, brokerList);
            if (ret.get(i).size() != ret.get(0).size()) {
                throw new AdminOperationException("Partition " + i + " has different replication factor: " + brokerList);
            }
        }
        return ret;
    }
@Test
    public void testParseAssignmentDuplicateEntries() {
        assertThrows(AdminCommandFailedException.class, () -> TopicCommand.parseReplicaAssignment("5:5"));
    }