@Override
    public synchronized Set<TaskId> allTaskIds() {
        return union(HashSet::new, activeTasksPerId.keySet(), standbyTasksPerId.keySet());
    }
All tasks returned by any of the getters are read-only and should NOT be modified;
and the returned task could be modified by other threads concurrently
streams/src/main/java/org/apache/kafka/streams/processor/internals/Tasks.java