Here you can find the source of contains( C collection, K key)
Parameter | Description |
---|---|
map | a parameter |
key | a parameter |
public static <K, C extends Collection<K>> boolean contains( C collection, K key)
//package com.java2s; import java.util.Collection; public class Main { /**/*from w w w . j a va2s . c om*/ * Type-safe contains * @param map * @param key * @return value */ public static <K, C extends Collection<K>> boolean contains( C collection, K key) { return collection.contains(key); } }