public static Map<Integer, Uuid> createAssignmentMap(int[] replicas, Uuid[] directories) {
        if (replicas.length != directories.length) {
            throw new IllegalArgumentException("The lengths for replicas and directories do not match.");
        }
        Map<Integer, Uuid> assignments = new HashMap<>();
        for (int i = 0; i < replicas.length; i++) {
            int brokerId = replicas[i];
            Uuid directory = directories[i];
            if (assignments.put(brokerId, directory) != null) {
                throw new IllegalArgumentException("Duplicate broker ID in assignment");
            }
        }
        return assignments;
    }
@Test
    void testCreateAssignmentMap() {
        assertThrows(IllegalArgumentException.class, () ->
                DirectoryId.createAssignmentMap(new int[]{1, 2}, DirectoryId.unassignedArray(3)));
        assertEquals(
            new HashMap<Integer, Uuid>() {{
                    put(1, Uuid.fromString("upjfkCrUR9GNn1i94ip1wg"));
                    put(2, Uuid.fromString("bCF3l0RIQjOKhUqgbivHZA"));
                    put(3, Uuid.fromString("Fg3mFhcVQlqCWRk4dZazxw"));
                    put(4, Uuid.fromString("bv9TEYi4TqOm52hLmrxT5w"));
                }},
            DirectoryId.createAssignmentMap(
                    new int[] {1, 2, 3, 4},
                    new Uuid[] {
                            Uuid.fromString("upjfkCrUR9GNn1i94ip1wg"),
                            Uuid.fromString("bCF3l0RIQjOKhUqgbivHZA"),
                            Uuid.fromString("Fg3mFhcVQlqCWRk4dZazxw"),
                            Uuid.fromString("bv9TEYi4TqOm52hLmrxT5w")
                    })
        );
    }