Here you can find the source of containsItems(List smallerList, List largerList)
public static boolean containsItems(List smallerList, List largerList)
//package com.java2s; import java.util.*; public class Main { public static boolean containsItems(List smallerList, List largerList) { List tempList = new ArrayList(); for (Object o : largerList) tempList.add(o);/* w ww .j a v a2 s.co m*/ for (Object check : smallerList) { if (tempList.contains(check)) tempList.remove(check); // necessary to cope with duplicate objects else return false; } return true; } }