Package java.util

Examples of java.util.IdentityHashMap.containsValue()


      assertTrue("EntrySetIterator can not find entry ", entries
          .contains(entry));

      assertTrue("entry key not found in map", map.containsKey(entry
          .getKey()));
      assertTrue("entry value not found in map", map.containsValue(entry
          .getValue()));

      assertTrue("entry key not found in the keyset", keyset
          .contains(entry.getKey()));
      assertTrue("entry value not found in the valueset", valueset
View Full Code Here


    Collection vals = map.values();
    boolean result = vals.remove(key);
    assertTrue("removed entries incorrectly", map.size() == 11 && !result);
    assertTrue("removed key incorrectly", map.containsKey(key));
    assertTrue("removed value incorrectly", map.containsValue(value));

    result = vals.remove(value);
    assertTrue("Did not remove entry as expected", map.size() == 10
        && result);
    assertTrue("Did not remove key as expected", !map.containsKey(key));
View Full Code Here

    result = vals.remove(value);
    assertTrue("Did not remove entry as expected", map.size() == 10
        && result);
    assertTrue("Did not remove key as expected", !map.containsKey(key));
    assertTrue("Did not remove value as expected", !map
        .containsValue(value));

    // put an equivalent key to a value
    key = new Integer(1);
    value = new Integer(100);
View Full Code Here

    result = vals.remove(key);
    assertTrue("TestB. removed entries incorrectly", map.size() == 11
        && !result);
    assertTrue("TestB. removed key incorrectly", map.containsKey(key));
    assertTrue("TestB. removed value incorrectly", map.containsValue(value));

    result = vals.remove(value);
    assertTrue("TestB. Did not remove entry as expected", map.size() == 10
        && result);
    assertTrue("TestB. Did not remove key as expected", !map
View Full Code Here

    result = vals.remove(value);
    assertTrue("TestB. Did not remove entry as expected", map.size() == 10
        && result);
    assertTrue("TestB. Did not remove key as expected", !map
        .containsKey(key));
    assertTrue("TestB. Did not remove value as expected", !map
        .containsValue(value));

    vals.clear();
    assertEquals("Did not remove all entries as expected", 0, map.size());
  }
View Full Code Here

      myIdentityHashMap.put(objArray2[i], objArray[i]);
    Collection values = myIdentityHashMap.values();
    values.remove(objArray[0]);
    assertTrue(
        "Removing from the values collection should remove from the original map",
        !myIdentityHashMap.containsValue(objArray2[0]));

  }
 
  /**
   * Sets up the fixture, for example, open a network connection. This method
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.