Here's some code that IntelliJ recommended I used ...
# announcements
r
Here's some code that IntelliJ recommended I used Sequence with (hence the asSequence and toList)
Copy code
task.command.requiredSubsystems.asSequence().filter { msg.shouldStartDefault(it) }
                    .mapNotNull(Subsystem::defaultCommand).toList()
                    .forEach {
                        handle(Message.Start(it))
                    }
g
toList is redundant in this case. If Kotlin plugin convert it like that you should report an issue, because
forEach
available for sequences, no need to convert to list