Here you can find the source of containsIdentity(Collection extends T> collection, T element)
public static <T> boolean containsIdentity(Collection<? extends T> collection, T element)
//package com.java2s; import java.util.Collection; public class Main { public static <T> boolean containsIdentity(Collection<? extends T> collection, T element) { for (T e : collection) if (e == element) return true; return false; }// w w w. j a v a2s . c o m }