public Map makeEmptyMap() { return new StaticBucketMap(30); }
public void test_containsKey_nullMatchesIncorrectly() { StaticBucketMap map = new StaticBucketMap(17); map.put(null, "A"); assertEquals(true, map.containsKey(null)); // loop so we find a string that is in the same bucket as the null for (int i = 'A'; i <= 'Z'; i++) { String str = String.valueOf((char) i); assertEquals("String: " + str, false, map.containsKey(str)); } }
public void test_get_nullMatchesIncorrectly() { StaticBucketMap map = new StaticBucketMap(17); map.put(null, "A"); assertEquals("A", map.get(null)); // loop so we find a string that is in the same bucket as the null for (int i = 'A'; i <= 'Z'; i++) { String str = String.valueOf((char) i); assertEquals("String: " + str, null, map.get(str)); } }
public void test_containsValue_nullMatchesIncorrectly() { StaticBucketMap map = new StaticBucketMap(17); map.put("A", null); assertEquals(true, map.containsValue(null)); // loop so we find a string that is in the same bucket as the null for (int i = 'A'; i <= 'Z'; i++) { String str = String.valueOf((char) i); assertEquals("String: " + str, false, map.containsValue(str)); } }
/** * Create the hint map for a role. The map may have to take care for thread-safety. * By default a StaticBucketMap is created, but you may change the implementation * or increment the number of buckets according your needs. * * <div> * <span style="font-weight:strong;text-color: red;">WARNING:</span> * This Map must be threadsafe, so either use the * <code>StaticBucketMap</code> or a synchronized <code>Map</code>. * Otherwise you will experience erratic behavior due to the nature * of the asyncronous component management. * </div> * * @return the hint map implementation */ protected Map createHintMap() { return new StaticBucketMap(); }