Java tutorial
//package com.java2s; import java.util.Collection; public class Main { public static <T> boolean containsByValue(Collection<? extends T> c, T item) { if (c == null || c.isEmpty()) return false; for (T i : c) { if (i.equals(item)) return true; } return false; } }