Here you can find the source of contains(Collection
Parameter | Description |
---|---|
collection | collection to look in |
item | item to look for |
public static <T> boolean contains(Collection<T> collection, T item)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { /**//from w ww . j a va 2 s . co m * Checks if the given collection contains the specified item. * * @param collection collection to look in * @param item item to look for * @return <tt>true</tt> if the item was found */ public static <T> boolean contains(Collection<T> collection, T item) { return collection.contains(item); } }