What are the analogs of Java 8 Stream.collect in the Kotlin standard library?
Hello! I'm transitioning from Java to Kotlin and actively studying the standard library. In Java, I often used the Stream API, especially the collect method with various collectors: Collectors.toList(), Collectors.groupingBy(), Collectors.joining(), etc.
For example, in Java I could write:
\n\nList<String> names = people.stream()\n .filter(p -> p.getAge() > 18)\n .map(Person::getName)\n .collect(Collectors.toList());\n\n\nOr group people by age:
\n\nMap<Integer, List<Person>> byAge = people.stream()\n .collect(Collectors.groupingBy(Person::getAge));\n\n\nIn Kotlin, I see that there are functions .filter, .map, but I can't find