@Override
    public synchronized Map<TaskId, Task> allTasksPerId() {
        final Map<TaskId, Task> ret = new HashMap<>();
        ret.putAll(activeTasksPerId);
        ret.putAll(standbyTasksPerId);
        return ret;
    }
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