When given two Iterables
val keys = newLinkedList('foo', 'bar', 'bla')
val vals = newLinkedList(42, 43, 44)
I want to correlate each item in both lists like this:
val Iterable<Pair<String, Integer>> expected
= newLinkedList('foo'->42, 'bar'->43, 'bla'->44)
OK, I could do it by hand iterating over both lists.
On the other hand this smells like something where
- some standard function is available in Xtend or guava or
- some neat trick will do it in one line.
For examples in Python this would be a no-brainer, because their map function can take multiple lists.
How can this be solved using Xtend2+ with miniumum code?