@Override
    public boolean contains(final TaskId taskId) {
        return getTask(taskId) != null;
    }
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