Comments on: Java Stream: Is a Count Always a Count? https://speedment.com/java-stream-is-a-count-always-a-count/ Build Fast Java Applications for the Fastest Business Performance Fri, 01 May 2020 05:21:37 +0000 hourly 1 https://wordpress.org/?v=5.1.1 By: Per Minborg https://speedment.com/java-stream-is-a-count-always-a-count/#comment-47 Thu, 11 Apr 2019 17:48:10 +0000 https://speedment.com/java-stream-is-a-count-always-a-count/#comment-47 Thanks for you perfectly correct comment Nicolai. I think this is material for a follow up article where this should be elaborated further.

]]>
By: Nicolai Parlog https://speedment.com/java-stream-is-a-count-always-a-count/#comment-48 Thu, 11 Apr 2019 12:00:35 +0000 https://speedment.com/java-stream-is-a-count-always-a-count/#comment-48 This is only true on Java 8. Since Java 9, `count` is short-circuited for streams whose size is known (as is the case here) – see this tweet.

]]>