Java List Difference difference(List set1, List set2)

Here you can find the source of difference(List set1, List set2)

Description

difference

License

Apache License

Declaration

public static <T> List<T> difference(List<T> set1, List<T> set2) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static <T> List<T> difference(List<T> set1, List<T> set2) {
        List<T> diff = new ArrayList<T>(set1);
        diff.removeAll(set2);//from ww  w  .  j  av a2s .c o m

        return diff;
    }
}

Related

  1. difference(final List minuend, final List subtrahend)
  2. difference(final List list1, final List list2)
  3. difference(final String[] list1, final String[] list2)
  4. difference(List firstList, List secondList)
  5. difference(List lst1, List lst2)
  6. differenceOfList(List a, List b)
  7. differentCategory(String prop1, String prop2, List cat1, List cat2)
  8. diffFloats(List a, List b)
  9. diffList(List aList, List bList)