firstlist
.stream()
.map( x -> {
return secondList
.stream()
.map( y -> { //return a string } )
.collect(Collectors.toList()) // "Output" I need
}
)
.//Get the "Output" here
I have two list. the item in first list have to compared with second list and new list have to built.
Sample Input
List 1 : [ { "id" ; 3, "names" : ["test","test2"] }]
List 2 : [ {"name": :"test" , "age" :3}]
Output:
List 3 : [ {"id" : 3, "name" : "test", "age" :3} ]
P.S: The names in first list should be checked against second list
POJOfor both the lists ?