Here you can find the source of iterableContains(Iterable
itrbl
contains the element elem
.
public static <E> boolean iterableContains(Iterable<E> itrbl, E elem)
//package com.java2s; // Licensed under the Modified BSD Licence; see COPYING for details. public class Main { /** Checks whether <code>itrbl</code> contains the element <code>elem</code>. */ public static <E> boolean iterableContains(Iterable<E> itrbl, E elem) { for (E e : itrbl) { if (e.equals(elem)) return true; }//from w w w .ja v a2 s . c om return false; } }