}
}
public void test_AscendingSubMapEntrySet_higher() {
Set entrySet;
NavigableSet ascendingSubMapEntrySet;
Iterator iterator;
Entry entry, lowerEntry;
int value;
entrySet = navigableMap_startExcluded_endExcluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 108) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);
}
}
}
entrySet = navigableMap_startExcluded_endIncluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 109) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);
}
}
}
entrySet = navigableMap_startIncluded_endExcluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 108) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);
}
}
}
entrySet = navigableMap_startIncluded_endIncluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 109) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);
}
}
}
String endKey = new Integer(2).toString();
entrySet = tm.headMap(endKey, true).entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = entrySet.iterator();
entry = (Entry) iterator.next();
Entry expectedEntry = (Entry) iterator.next();
assertEquals(expectedEntry, ascendingSubMapEntrySet.higher(entry));
}
// With Comparator
entrySet = subMap_startExcluded_endExcluded_comparator.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 108) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);
}
}
}
entrySet = subMap_startExcluded_endIncluded_comparator.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 109) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);
}
}
}
entrySet = subMap_startIncluded_endExcluded_comparator.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 108) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);
}
}
}
entrySet = subMap_startIncluded_endIncluded_comparator.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = ascendingSubMapEntrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
lowerEntry = (Entry) ascendingSubMapEntrySet.higher(entry);
value = (Integer) entry.getValue();
if (value < 109) {
assertEquals(value + 1, lowerEntry.getValue());
} else {
assertNull(lowerEntry);