Here you can find the source of getContainedEquals(Collection
public static <T> T getContainedEquals(Collection<T> a, T b)
//package com.java2s; import java.util.Collection; public class Main { public static <T> T getContainedEquals(Collection<T> a, T b) { for (T t : a) { if (b.equals(t)) return t; }// w w w . j ava2 s .co m return null; } }