Using Google Guava (Google Commons), is there a way to merge two equally sized lists into one list, with the new list containing composite objects of the two input lists?
You can refer to underscore-java library.
Underscore-java is a port of Underscore.js for Java, and the zip method can achieve the goal.
Underscore-java
Underscore.js
zip
Following is a sample code & output :
$.zip(Arrays.asList("moe", "larry", "curly"), Arrays.asList("30", "40", "50"));
=> [[moe, 30], [larry, 40], [curly, 50]]