Package java.util

Examples of java.util.IdentityHashMap.containsValue()


    assertTrue(dstMap.containsValue(VALUE_2));
    assertFalse(dstMap.containsKey(StringCase.toUpper(KEY_2)));
    assertFalse(dstMap.containsValue(StringCase.toUpper(VALUE_2)));

    assertTrue(dstMap.containsKey(KEY_3));
    assertTrue(dstMap.containsValue(VALUE_3));
    assertFalse(dstMap.containsKey(StringCase.toUpper(KEY_3)));
    assertFalse(dstMap.containsValue(StringCase.toUpper(VALUE_3)));

    // Check that an empty map does not blow away the contents of the
    // destination map
View Full Code Here


    assertFalse(dstMap.containsValue(StringCase.toUpper(VALUE_2)));

    assertTrue(dstMap.containsKey(KEY_3));
    assertTrue(dstMap.containsValue(VALUE_3));
    assertFalse(dstMap.containsKey(StringCase.toUpper(KEY_3)));
    assertFalse(dstMap.containsValue(StringCase.toUpper(VALUE_3)));

    // Check that an empty map does not blow away the contents of the
    // destination map
    IdentityHashMap emptyMap = new IdentityHashMap();
    checkEmptyHashMapAssumptions(emptyMap);
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

    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

    Object result;

    // null key and null value
    result = map.put(null, null);
    assertTrue("testA can not find null key", map.containsKey(null));
    assertTrue("testA can not find null value", map.containsValue(null));
    assertNull("testA can not get null value for null key",
        map.get(null));
    assertNull("testA put returned wrong value", result);

    // null value
View Full Code Here

    // null value
    String value = "a value";
    result = map.put(null, value);
    assertTrue("testB can not find null key", map.containsKey(null));
    assertTrue("testB can not find a value with null key", map
        .containsValue(value));
    assertTrue("testB can not get value for null key",
        map.get(null) == value);
    assertNull("testB put returned wrong value", result);
View Full Code Here

    // a null key
    String key = "a key";
    result = map.put(key, null);
    assertTrue("testC can not find a key with null value", map
        .containsKey(key));
    assertTrue("testC can not find null value", map.containsValue(null));
    assertNull("testC can not get null value for key", map.get(key));
    assertNull("testC put returned wrong value", result);

    // another null key
    String anothervalue = "another value";
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.