Package java.util

Examples of java.util.IdentityHashMap.containsValue()


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


    // remove a null key
    result = map.remove(null);
    assertTrue("testE remove returned wrong value", result == anothervalue);
    assertTrue("testE should not find null key", !map.containsKey(null));
    assertTrue("testE should not find a value with null key", !map
        .containsValue(anothervalue));
    assertNull("testE should not get value for null key",
        map.get(null));
  }
View Full Code Here

    map.put("key1", "value1");
    map.put("key2", "value2");
    map.remove("key1");

    assertTrue("Did not remove key1", !map.containsKey("key1"));
    assertTrue("Did not remove the value for key1", !map
        .containsValue("value1"));

    assertTrue("Modified key2", map.get("key2") != null
        && map.get("key2") == "value2");
    assertNull("Modified null entry", map.get(null));
View Full Code Here

      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

    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

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

    // remove a null key
    result = map.remove(null);
    assertTrue("testE remove returned wrong value", result == anothervalue);
    assertTrue("testE should not find null key", !map.containsKey(null));
    assertTrue("testE should not find a value with null key", !map
        .containsValue(anothervalue));
    assertNull("testE should not get value for null key",
        map.get(null));
  }
View Full Code Here

    map.put("key1", "value1");
    map.put("key2", "value2");
    map.remove("key1");

    assertTrue("Did not remove key1", !map.containsKey("key1"));
    assertTrue("Did not remove the value for key1", !map
        .containsValue("value1"));

    assertTrue("Modified key2", map.get("key2") != null
        && map.get("key2") == "value2");
    assertNull("Modified null entry", map.get(null));
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.