Example usage for java.util.concurrent ConcurrentMap containsValue

List of usage examples for java.util.concurrent ConcurrentMap containsValue

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentMap containsValue.

Prototype

boolean containsValue(Object value);

Source Link

Document

Returns true if this map maps one or more keys to the specified value.

Usage

From source file:com.googlecode.concurrentlinkedhashmap.ConcurrentMapTest.java

@Test(dataProvider = "guardedMap")
public void removeConditionally(ConcurrentMap<Integer, Integer> map) {
    map.put(1, 2);/*from  w ww. ja  v  a 2s  . c o  m*/
    assertThat(map.remove(1, -2), is(false));
    assertThat(map.remove(1, 2), is(true));
    assertThat(map.get(1), is(nullValue()));
    assertThat(map.containsKey(1), is(false));
    assertThat(map.containsValue(2), is(false));
    assertThat(map, is(emptyMap()));
}