Here you can find the source of leftDifference(final Collection c1, final Collection c2)
public static Collection leftDifference(final Collection c1, final Collection c2)
//package com.java2s; import java.util.ArrayList; import java.util.Collection; import java.util.List; public class Main { public static Collection leftDifference(final Collection c1, final Collection c2) { return rightDifference(c2, c1); }/*from w w w . j av a 2s. c o m*/ public static Collection rightDifference(final Collection c1, final Collection c2) { final List result = new ArrayList(); final Object[] members_c1 = c1.toArray(); for (int i = 0; i < members_c1.length; i++) { if (!c2.contains(members_c1[i])) { result.add(members_c1[i]); } } return result; } }