instead of the loop you can do `builder.addAllTasks(tasks.toList.asJava)`