Is there a concise way to iterate over a stream whilst having access to the index in the stream?
String[] names = {\"Sam\",\"Pamela\", \"Dave\", \"Pascal\",
Here is code by AbacusUtil
Stream.of(names).indexed() .filter(e -> e.value().length() <= e.index()) .map(Indexed::value).toList();
Disclosure: I'm the developer of AbacusUtil.