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.
Build tools, test dependencies, and intermediate artifacts have no business being in your production image. Multi-stage builds solve this cleanly.