"no data structures, no OOP"
Sequence
and Consumer
are objects, by the way. And you can do this with for
loops and avoid using both. Also, it's not clear what you mean by "If for its implementation it is necessary to write it specifically in Java (and, say, in basic JS it is impossible to implement it) - it is wrong."