Here you can find the source of containsInstance(Collection collection, Object element)
public static boolean containsInstance(Collection collection, Object element)
//package com.java2s; //License from project: Apache License import java.util.Collection; import java.util.Iterator; public class Main { public static boolean containsInstance(Collection collection, Object element) { if (collection != null) { Iterator i$ = collection.iterator(); while (i$.hasNext()) { Object candidate = i$.next(); if (candidate == element) { return true; }/*from w ww .ja va 2 s.co m*/ } } return false; } }