TIL: Stream.toList() vs Collectors.toList() in Java
· 2 min read
Java 16 introduced Stream.toList() as a shorter way to collect a stream into a list. Looks like a simple convenience method — turns out there's a meaningful difference.
Java 16 introduced Stream.toList() as a shorter way to collect a stream into a list. Looks like a simple convenience method — turns out there's a meaningful difference.