I\'m having two lists of same size ids and results and I want to create new list with domain objects.
ids
results
List ids = ... Lis
The equivalent of this way with Streams would be :
Streams
List list = IntStream.range(0, ids.size()) .mapToObj(i -> new DomainObject(ids.get(i), results.get(i))) .collect(Collectors.toList());
Or take a look at Iterate two Java-8-Streams