Java List Contain containsItems(List smallerList, List largerList)

Here you can find the source of containsItems(List smallerList, List largerList)

Description

contains Items

License

Open Source License

Declaration

public static boolean containsItems(List smallerList, List largerList) 

Method Source Code


//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;
    }
}

Related

  1. containsInEach(List first, List second)
  2. ContainsInList(String list, String value)
  3. containsInOrder(List a, List b)
  4. containsInstance(final List list, final Class clazz)
  5. containsInstance(List list, Object object)
  6. containsNonPositives(List vals)
  7. containsNull(List list)
  8. containsNullElement(List source)
  9. containsOneEqualElem(List first, List second)