There are collections:

ArrayList<String> list = new ArrayList<>(); list.add("1"); list.add("2"); ArrayList<String> list1 = new ArrayList<>(); list1.add("3"); list1.add("1"); list1.add("2"); list1.add("4"); list1.add("1"); 

Is there any method to check if list1 all list elements?

    1 answer 1

    Yes there is :

     if (list1.containsAll(list)) { // ... }