I would like to do the following:
List list = IntStream.range(0, 7).collect(Collectors.toList());
but in a way that the resu
While not a direct answer to my question (it does not use collectors), this is a fairly elegant approach which doesn't use intermediate collections:
Stream stream = IntStream.range(0, 7).boxed(); List list = ImmutableList.copyOf(stream.iterator());
Source.