798 |
|
*/ |
799 |
|
public void testSubMapContents() { |
800 |
|
ConcurrentSkipListMap map = map5(); |
801 |
< |
NavigableMap sm = map.navigableSubMap(two, true, four, false); |
801 |
> |
NavigableMap sm = map.subMap(two, true, four, false); |
802 |
|
assertEquals(two, sm.firstKey()); |
803 |
|
assertEquals(three, sm.lastKey()); |
804 |
|
assertEquals(2, sm.size()); |
836 |
|
|
837 |
|
public void testSubMapContents2() { |
838 |
|
ConcurrentSkipListMap map = map5(); |
839 |
< |
NavigableMap sm = map.navigableSubMap(two, true, three, false); |
839 |
> |
NavigableMap sm = map.subMap(two, true, three, false); |
840 |
|
assertEquals(1, sm.size()); |
841 |
|
assertEquals(two, sm.firstKey()); |
842 |
|
assertEquals(two, sm.lastKey()); |
871 |
|
*/ |
872 |
|
public void testHeadMapContents() { |
873 |
|
ConcurrentSkipListMap map = map5(); |
874 |
< |
NavigableMap sm = map.navigableHeadMap(four, false); |
874 |
> |
NavigableMap sm = map.headMap(four, false); |
875 |
|
assertTrue(sm.containsKey(one)); |
876 |
|
assertTrue(sm.containsKey(two)); |
877 |
|
assertTrue(sm.containsKey(three)); |
897 |
|
*/ |
898 |
|
public void testTailMapContents() { |
899 |
|
ConcurrentSkipListMap map = map5(); |
900 |
< |
NavigableMap sm = map.navigableTailMap(two, true); |
900 |
> |
NavigableMap sm = map.tailMap(two, true); |
901 |
|
assertFalse(sm.containsKey(one)); |
902 |
|
assertTrue(sm.containsKey(two)); |
903 |
|
assertTrue(sm.containsKey(three)); |
941 |
|
assertEquals("E", e.getValue()); |
942 |
|
assertFalse(i.hasNext()); |
943 |
|
|
944 |
< |
NavigableMap ssm = sm.navigableTailMap(four, true); |
944 |
> |
NavigableMap ssm = sm.tailMap(four, true); |
945 |
|
assertEquals(four, ssm.firstKey()); |
946 |
|
assertEquals(five, ssm.lastKey()); |
947 |
|
assertTrue(ssm.remove(four) != null); |
970 |
|
check(map, 0, mapSize - 1, true); |
971 |
|
check(map.descendingMap(), 0, mapSize - 1, false); |
972 |
|
|
973 |
< |
bashSubMap(map.navigableSubMap(0, true, mapSize, false), |
973 |
> |
bashSubMap(map.subMap(0, true, mapSize, false), |
974 |
|
0, mapSize - 1, true); |
975 |
|
} |
976 |
|
|
1077 |
|
|
1078 |
|
// headMap - pick direction and endpoint inclusion randomly |
1079 |
|
boolean incl = rnd.nextBoolean(); |
1080 |
< |
NavigableMap<Integer,Integer> hm = map.navigableHeadMap(midPoint, incl); |
1080 |
> |
NavigableMap<Integer,Integer> hm = map.headMap(midPoint, incl); |
1081 |
|
if (ascending) { |
1082 |
|
if (rnd.nextBoolean()) |
1083 |
|
bashSubMap(hm, min, midPoint - (incl ? 0 : 1), true); |
1094 |
|
|
1095 |
|
// tailMap - pick direction and endpoint inclusion randomly |
1096 |
|
incl = rnd.nextBoolean(); |
1097 |
< |
NavigableMap<Integer,Integer> tm = map.navigableTailMap(midPoint,incl); |
1097 |
> |
NavigableMap<Integer,Integer> tm = map.tailMap(midPoint,incl); |
1098 |
|
if (ascending) { |
1099 |
|
if (rnd.nextBoolean()) |
1100 |
|
bashSubMap(tm, midPoint + (incl ? 0 : 1), max, true); |
1119 |
|
boolean lowIncl = rnd.nextBoolean(); |
1120 |
|
boolean highIncl = rnd.nextBoolean(); |
1121 |
|
if (ascending) { |
1122 |
< |
NavigableMap<Integer,Integer> sm = map.navigableSubMap( |
1122 |
> |
NavigableMap<Integer,Integer> sm = map.subMap( |
1123 |
|
endpoints[0], lowIncl, endpoints[1], highIncl); |
1124 |
|
if (rnd.nextBoolean()) |
1125 |
|
bashSubMap(sm, endpoints[0] + (lowIncl ? 0 : 1), |
1128 |
|
bashSubMap(sm.descendingMap(), endpoints[0] + (lowIncl ? 0 : 1), |
1129 |
|
endpoints[1] - (highIncl ? 0 : 1), false); |
1130 |
|
} else { |
1131 |
< |
NavigableMap<Integer,Integer> sm = map.navigableSubMap( |
1131 |
> |
NavigableMap<Integer,Integer> sm = map.subMap( |
1132 |
|
endpoints[1], highIncl, endpoints[0], lowIncl); |
1133 |
|
if (rnd.nextBoolean()) |
1134 |
|
bashSubMap(sm, endpoints[0] + (lowIncl ? 0 : 1), |