287 |
|
assertEquals("A", (String)map.get(one)); |
288 |
|
ConcurrentHashMap empty = new ConcurrentHashMap(); |
289 |
|
assertNull(map.get("anything")); |
290 |
+ |
assertNull(empty.get("anything")); |
291 |
|
} |
292 |
|
|
293 |
|
/** |
538 |
|
try { |
539 |
|
new ConcurrentHashMap(-1, .75f); |
540 |
|
shouldThrow(); |
541 |
< |
} catch (IllegalArgumentException e) {} |
541 |
> |
} catch (IllegalArgumentException success) {} |
542 |
|
|
543 |
|
try { |
544 |
|
new ConcurrentHashMap(16, -1); |
545 |
|
shouldThrow(); |
546 |
< |
} catch (IllegalArgumentException e) {} |
546 |
> |
} catch (IllegalArgumentException success) {} |
547 |
|
} |
548 |
|
|
549 |
|
/** |
554 |
|
try { |
555 |
|
new ConcurrentHashMap(-1, .75f, 1); |
556 |
|
shouldThrow(); |
557 |
< |
} catch (IllegalArgumentException e) {} |
557 |
> |
} catch (IllegalArgumentException success) {} |
558 |
|
|
559 |
|
try { |
560 |
|
new ConcurrentHashMap(16, -1, 1); |
561 |
|
shouldThrow(); |
562 |
< |
} catch (IllegalArgumentException e) {} |
562 |
> |
} catch (IllegalArgumentException success) {} |
563 |
|
|
564 |
|
try { |
565 |
|
new ConcurrentHashMap(16, .75f, -1); |
566 |
|
shouldThrow(); |
567 |
< |
} catch (IllegalArgumentException e) {} |
567 |
> |
} catch (IllegalArgumentException success) {} |
568 |
|
} |
569 |
|
|
570 |
|
/** |
575 |
|
try { |
576 |
|
new ConcurrentHashMap(null); |
577 |
|
shouldThrow(); |
578 |
< |
} catch (NullPointerException e) {} |
578 |
> |
} catch (NullPointerException success) {} |
579 |
|
} |
580 |
|
|
581 |
|
/** |