Here you can find the source of firstUnique(List
static <T> T firstUnique(List<T> list)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { static <T> T firstUnique(List<T> list) { List<T> temp = new ArrayList<>(list); for (int i = 0; i < temp.size(); i++) { T elem = temp.get(i);/*from www.j a v a 2s . c om*/ temp.remove(elem); if (!temp.contains(elem)) { return elem; } } return null; } }