Example usage for org.apache.commons.collections MultiHashMap containsKey

List of usage examples for org.apache.commons.collections MultiHashMap containsKey

Introduction

In this page you can find the example usage for org.apache.commons.collections MultiHashMap containsKey.

Prototype

public boolean containsKey(Object key) 

Source Link

Document

Returns true if this map contains a mapping for the specified key.

Usage

From source file:org.unigram.likelike.lsh.TestLSHRecommendations.java

private void check(MultiHashMap resultMap) {
    /* basic test cases */
    Collection coll = (Collection) resultMap.get(new Long(0));
    assertTrue(coll.size() >= 2 && coll.size() <= 4);
    coll = (Collection) resultMap.get(new Long(1));
    assertTrue(coll.size() >= 2 && coll.size() <= 4);
    coll = (Collection) resultMap.get(new Long(2));
    assertTrue(coll.size() >= 2 && coll.size() <= 4);
    coll = (Collection) resultMap.get(new Long(3));
    assertTrue(coll.size() >= 1 && coll.size() <= 3);

    /* examples with no recommendation */
    assertFalse(resultMap.containsKey(new Long(7)));
    assertFalse(resultMap.containsKey(new Long(8)));
}