Java tutorial
//package com.java2s; import java.util.*; public class Main { public static <T1> List<T1> allOverlaps(Collection<T1> lst, Collection<T1> lst_) { List<T1> overlaps = new ArrayList<>(); for (T1 elem : lst) { if (lst_.contains(elem)) overlaps.add(elem); } return overlaps; } }