public void setAssignedTasks(final KafkaStreamsAssignment assignment) {
        final Set<TaskId> activeTasks = assignment.tasks().values().stream()
            .filter(task -> task.type() == ACTIVE).map(KafkaStreamsAssignment.AssignedTask::id)
            .collect(Collectors.toSet());
        final Set<TaskId> standbyTasks = assignment.tasks().values().stream()
            .filter(task -> task.type() == STANDBY).map(KafkaStreamsAssignment.AssignedTask::id)
            .collect(Collectors.toSet());
        assignedActiveTasks.setTaskIds(activeTasks);
        assignedStandbyTasks.setTaskIds(standbyTasks);
    }
@return the previous tasks assigned to this consumer ordered by lag, filtered for any tasks that don't exist in this assignment
streams/src/main/java/org/apache/kafka/streams/processor/internals/assignment/ClientState.java