public static void encodeTasks(final ByteBuffer buf,
                                   final Collection<TaskId> taskIds,
                                   final int version) {
        buf.putInt(taskIds.size());
        for (final TaskId id : taskIds) {
            writeTaskIdTo(id, buf, version);
        }
    }
@throws TaskAssignmentException if method fails to encode the data
streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/LegacySubscriptionInfoSerde.java