public static ExtendedAssignment duplicate(ExtendedAssignment assignment) {
        return new ExtendedAssignment(
                assignment.version(),
                assignment.error(),
                assignment.leader(),
                assignment.leaderUrl(),
                assignment.offset(),
                new LinkedHashSet<>(assignment.connectors()),
                new LinkedHashSet<>(assignment.tasks()),
                new LinkedHashSet<>(assignment.revokedConnectors()),
                new LinkedHashSet<>(assignment.revokedTasks()),
                assignment.delay());
    }
Create an assignment indicating responsibility for the given connector instances and task Ids.

@param version Connect protocol version
@param error error code for this assignment; {@link ConnectProtocol.Assignment#NO_ERROR}
             indicates no error during assignment
@param leader Connect group's leader Id; may be null only on the empty assignment
@param leaderUrl Connect group's leader URL; may be null only on the empty assignment
@param configOffset the offset in the config topic that this assignment is corresponding to
@param connectorIds list of connectors that the worker should instantiate and run; may not be null
@param taskIds list of task IDs that the worker should instantiate and run; may not be null
@param revokedConnectorIds list of connectors that the worker should stop running; may not be null
@param revokedTaskIds list of task IDs that the worker should stop running; may not be null
@param delay the scheduled delay after which the worker should rejoin the group
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ExtendedAssignment.java