Here you can find the source of containsAll(List
public static <T> boolean containsAll(List<T> list, T... items)
//package com.java2s; //License from project: Apache License import java.util.Collection; import java.util.List; import java.util.Map; public class Main { public static <T> boolean containsAll(List<T> list, T... items) { if (isEmpty(list)) return false; if (items == null || items.length < list.size()) return false; // TODO This is not the most efficient search... for (T item : items) if (!list.contains(item)) return false; return true; }/*from w ww.j a va2 s.co m*/ public static boolean isEmpty(Iterable<?> i) { if (i instanceof Collection) return ((Collection<?>) i).isEmpty(); return i == null || !i.iterator().hasNext(); } public static boolean isEmpty(Map<?, ?> p_oCol) { return p_oCol == null || p_oCol.isEmpty(); } public static int size(Collection<?> col) { return col == null ? 0 : col.size(); } }