I have 3 lists that I need to compare and manipulate. Here are the lists, for example:
def list1 = ['abc', '123','789'];
def list2 = ['456', 'abc', '123'];
def list3 = ['mil', 'len', 'nium'];
I need to compare values of list1 and list2 and if they are the same, I need to return the corresponding item with the same index of list1 found in list3.
Using the example above, since list1[0] and list2[1] are the same, I need to return the list3 value, 'mil'.
The lists' value will also be dynamic so how will I be able to do it in groovy?