}
}
}
public void test_DescendingSubMap_ceilingEntry() {
NavigableMap decendingMap = tm.descendingMap();
String key = new Integer(-1).toString();
assertNull(decendingMap.ceilingEntry(key));
for (int i = 0; i < objArray.length; i++) {
key = objArray[i].toString();
assertEquals(objArray[i], decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(1000).toString();
assertEquals(100, decendingMap.ceilingEntry(key).getValue());
key = new Integer(1001).toString();
assertEquals(100, decendingMap.ceilingEntry(key).getValue());
decendingMap = navigableMap_startExcluded_endExcluded.descendingMap();
key = new Integer(100).toString();
assertNull(decendingMap.ceilingEntry(key));
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(108, decendingMap.ceilingEntry(key).getValue());
decendingMap = navigableMap_startExcluded_endIncluded.descendingMap();
key = new Integer(100).toString();
assertNull(decendingMap.ceilingEntry(key));
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(109, decendingMap.ceilingEntry(key).getValue());
decendingMap = navigableMap_startIncluded_endExcluded.descendingMap();
key = new Integer(100).toString();
assertEquals(100, decendingMap.ceilingEntry(key).getValue());
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(108, decendingMap.ceilingEntry(key).getValue());
decendingMap = navigableMap_startIncluded_endIncluded.descendingMap();
key = new Integer(100).toString();
assertEquals(100, decendingMap.ceilingEntry(key).getValue());
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(109, decendingMap.ceilingEntry(key).getValue());
// With Comparator
decendingMap = ((NavigableMap) subMap_startExcluded_endExcluded_comparator)
.descendingMap();
key = new Integer(100).toString();
assertNull(decendingMap.ceilingEntry(key));
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(108, decendingMap.ceilingEntry(key).getValue());
decendingMap = ((NavigableMap) subMap_startExcluded_endIncluded_comparator)
.descendingMap();
key = new Integer(100).toString();
assertNull(decendingMap.ceilingEntry(key));
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(109, decendingMap.ceilingEntry(key).getValue());
decendingMap = ((NavigableMap) subMap_startIncluded_endExcluded_comparator)
.descendingMap();
key = new Integer(100).toString();
assertEquals(100, decendingMap.ceilingEntry(key).getValue());
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(108, decendingMap.ceilingEntry(key).getValue());
decendingMap = ((NavigableMap) subMap_startIncluded_endIncluded_comparator)
.descendingMap();
key = new Integer(100).toString();
assertEquals(100, decendingMap.ceilingEntry(key).getValue());
for (int i = 101; i < 109; i++) {
key = new Integer(i).toString();
assertEquals(i, decendingMap.ceilingEntry(key).getValue());
}
key = new Integer(109).toString();
assertEquals(109, decendingMap.ceilingEntry(key).getValue());
}