1 |
|
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
|
* Expert Group and released to the public domain, as explained at |
4 |
< |
* http://creativecommons.org/licenses/publicdomain |
4 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
5 |
|
*/ |
6 |
|
|
7 |
|
import junit.framework.*; |
119 |
|
assertEquals(five, map.lastKey()); |
120 |
|
} |
121 |
|
|
122 |
– |
|
122 |
|
/** |
123 |
|
* keySet.toArray returns contains all keys |
124 |
|
*/ |
381 |
|
assertEquals("Z", map.get(one)); |
382 |
|
} |
383 |
|
|
385 |
– |
|
384 |
|
/** |
385 |
|
* replace value fails when the given key not mapped to expected value |
386 |
|
*/ |
401 |
|
assertEquals("Z", map.get(one)); |
402 |
|
} |
403 |
|
|
406 |
– |
|
404 |
|
/** |
405 |
|
* remove removes the correct key-value pair from the map |
406 |
|
*/ |
531 |
|
} |
532 |
|
|
533 |
|
|
537 |
– |
|
534 |
|
/** |
535 |
|
* lowerKey returns preceding element |
536 |
|
*/ |
674 |
|
ConcurrentSkipListMap map = map5(); |
675 |
|
String s = map.toString(); |
676 |
|
for (int i = 1; i <= 5; ++i) { |
677 |
< |
assertTrue(s.indexOf(String.valueOf(i)) >= 0); |
677 |
> |
assertTrue(s.contains(String.valueOf(i))); |
678 |
|
} |
679 |
|
} |
680 |
|
|
713 |
|
} catch (NullPointerException success) {} |
714 |
|
} |
715 |
|
|
720 |
– |
|
716 |
|
/** |
717 |
|
* put(null,x) throws NPE |
718 |
|
*/ |
809 |
|
assertTrue(r.equals(q)); |
810 |
|
} |
811 |
|
|
817 |
– |
|
818 |
– |
|
812 |
|
/** |
813 |
|
* subMap returns map with keys in requested range |
814 |
|
*/ |
1154 |
|
*/ |
1155 |
|
void check(NavigableMap<Integer, Integer> map, |
1156 |
|
final int min, final int max, final boolean ascending) { |
1157 |
< |
class ReferenceSet { |
1157 |
> |
class ReferenceSet { |
1158 |
|
int lower(int key) { |
1159 |
|
return ascending ? lowerAscending(key) : higherAscending(key); |
1160 |
|
} |