Say I have two lists of equal size [1, 2, 3, 4, ...] and [a, b, c, d, ...]. Is there a way I make a map with streams that maps 1 to a, 2 to b, 3 to c, and so on without using lambda functions or nested functions?
I would use map and pass in a function, but this passed-in function can only take 1 argument and I need both pieces of information to map the elements to each other.
IntStream(1, list1.size()).stream().map(this.&combineListsFunction).collect...
combineListsFunction
can only use the information from the stream, but I need both lists for the function to work.