Groovy find common elements in two lists

Return type Name and parameters boolean addAll(int index, Object[] items)
Modifies this list by inserting all of the elements in the specified array into the list at the specified position. List asImmutable()
A convenience method for creating an immutable list List asSynchronized()
A convenience method for creating a synchronized List. List drop(int num)
Drops the given number of elements from the head of this List. List dropRight(int num)
Drops the given number of elements from the tail of this List. List dropWhile(Closure condition)
Returns a suffix of this List where elements are dropped from the front while the given Closure evaluates to true. List each(Closure closure)
Iterates through a List, passing each item to the given closure. List eachWithIndex(Closure closure)
Iterates through a List, passing each item and the item's index (a counter starting at zero) to the given closure. boolean equals(Object[] right)
Determines if the contents of this list are equal to the contents of the given array in the same order. boolean equals(List right)
Compare the contents of two Lists. Process execute()
Executes the command specified by the given list. Process execute(String[] envp, File dir)
Executes the command specified by the given list, with the environment defined by envp and under the working directory dir. Process execute(List envp, File dir)
Executes the command specified by the given list, with the environment defined by envp and under the working directory dir. List findAll()
Finds the items matching the IDENTITY Closure (i.e.matching Groovy truth). List findAll(Closure closure)
Finds all values matching the closure condition. Object first()
Returns the first item from the List. List flatten()
Flatten a List. List getAt(EmptyRange range)
Support the range subscript operator for a List. List getAt(Range range)
Support the range subscript operator for a List. Object getAt(int idx)
Support the subscript operator for a List. List getAt(Collection indices)
Select a List of items from a List using a Collection to identify the indices to be selected. List grep()
Iterates over the collection returning each element that matches using the IDENTITY Closure as a filter - effectively returning all elements which satisfy Groovy truth. List grep(Object filter)
Iterates over the collection of items and returns each item that matches the given filter - calling the Object#isCase(java.lang.Object) method used by switch statements. Object head()
Returns the first item from the List. List init()
Returns the items from the List excluding the last item. List intersect(Iterable right)
Create a List composed of the intersection of a List and an Iterable. Object last()
Returns the last item from the List. List leftShift(Object value)
Overloads the left shift operator to provide an easy way to append objects to a List. List minus(Iterable removeMe)
Create a new List composed of the elements of the first List minus every occurrence of elements of the given Iterable. List minus(Object removeMe)
Create a new List composed of the elements of the first List minus every occurrence of the given element to remove. List minus(Collection removeMe)
Create a List composed of the elements of the first list minus every occurrence of elements of the given Collection. List multiply(Number factor)
Create a List composed of the elements of this Iterable, repeated a certain number of times. List plus(int index, Iterable additions)
Creates a new List by inserting all of the elements in the given Iterable to the elements from this List at the specified index. List plus(int index, Object[] items)
Creates a new List by inserting all of the elements in the specified array to the elements from the original List at the specified index. List plus(int index, List additions)
Creates a new List by inserting all of the elements in the given additions List to the elements from the original List at the specified index. List plus(Iterable right)
Create a List as a union of a List and an Iterable. List plus(Object right)
Create a List as a union of a List and an Object. List plus(Collection right)
Create a List as a union of a List and an Collection. Object pop()
Removes the last item from the List. boolean push(Object value)
Appends an item to the List. void putAt(EmptyRange range, Object value)
A helper method to allow lists to work with subscript operators. void putAt(EmptyRange range, Collection value)
A helper method to allow lists to work with subscript operators. void putAt(IntRange range, Object value)
List subscript assignment operator when given a range as the index. void putAt(IntRange range, Collection col)
List subscript assignment operator when given a range as the index and the assignment operand is a collection. void putAt(int idx, Object value)
A helper method to allow lists to work with subscript operators. void putAt(List splice, Object value)
A helper method to allow lists to work with subscript operators. void putAt(List splice, List values)
A helper method to allow lists to work with subscript operators. Object removeAt(int index)
Modifies this list by removing the element at the specified position in this list. List reverse()
Creates a new List with the identical contents to this list but in reverse order. List reverse(boolean mutate)
Reverses the elements in a list. List reverseEach(Closure closure)
Iterate over each element of the list in the reverse order. List split(Closure closure)
Splits all items into two collections based on the closure condition. Set subsequences()
Finds all non-null subsequences of a list. List swap(int i, int j)
Swaps two elements at the specified positions. List tail()
Returns the items from the List excluding the first item. List take(int num)
Returns the first num elements from the head of this List. List takeRight(int num)
Returns the last num elements from the tail of this List. List takeWhile(Closure condition)
Returns the longest prefix of this list where each element passed to the given closure condition evaluates to true. SpreadMap toSpreadMap()
Creates a spreadable map from this list. List toUnique()
Returns a List containing the items from the List but with duplicates removed using the natural ordering of the items to determine uniqueness. List toUnique(Closure condition)
Returns a List containing the items from the List but with duplicates removed. List toUnique(Comparator comparator)
Returns a List containing the items from the List but with duplicates removed. List transpose()
Adds GroovyCollections#transpose(List) as a method on lists. List unique()
Modifies this List to remove all duplicated items, using the default comparator. List unique(boolean mutate)
Remove all duplicates from a given List using the default comparator. List unique(boolean mutate, Closure closure)
A convenience method for making a List unique using a Closure to determine duplicate (equal) items. List unique(boolean mutate, Comparator comparator)
Remove all duplicates from a given List. List unique(Closure closure)
A convenience method for making a List unique using a Closure to determine duplicate (equal) items. List unique(Comparator comparator)
Remove all duplicates from a given List. List withDefault(Closure init)
An alias for withLazyDefault which decorates a list allowing it to grow when called with index values outside the normal list bounds. List withEagerDefault(Closure init)
Decorates a list allowing it to grow when called with a non-existent index value. List withLazyDefault(Closure init)
Decorates a list allowing it to grow when called with a non-existent index value.