Here you can find the source of getDiffentElement(List
public static List<String> getDiffentElement(List<String> minList, List<String> maxList)
//package com.java2s; import java.util.*; public class Main { public static List<String> getDiffentElement(List<String> minList, List<String> maxList) { List<String> newList = new ArrayList<String>(); for (String max : maxList) { if (!(minList.contains(max))) { newList.add(max);/* www. j av a 2 s . c om*/ } } return newList; } }