Java 8 Stream on Android
Nico Passo

You write that Java 8 Streams and LSA work mostly in the same under the hood, but that’s not the case. LSA misses the point of Streaming APIs.

The following, simple example, will just throw an exception with LSA, while it’s perfectly legal in Java 8 (I’d say it’s at the core of any Streaming API to support lazy evaluation):

ArrayList<String> strings = new ArrayList<>(Arrays.asList("Foo", "Bar"));<String> stream =;
stream = stream.filter(s -> s.equals("Bar"));
long count = stream.count();
assertEquals(count, 2);

I hope someone comes up with a conforming re-implementation for Android, soon.

Like what you read? Give Matt a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.