I was asked this question in a job interview (Microsoft).
methods to implement for example:
.stream(), .filter(), .map() , flatMap() , min() , count() , reduce() , groupBy()
etc
It's quite an open question but I think is an interesting one.
Thanks
filter,map,min... may begroupBycould be implemented fairly trivially, I meanguavadid it, before java-8. By trivial I mean trivial enough for the job interview answer.method("isEmpty").asPredicate(String.class); not as concise asString::isEmpty, but still shorter than implementing thePredicateusing an anonymous inner class. But that’s not the question; the question was “How to implement the Stream API” and the answer would be, just like any other interface, wouldn’t it?