// }
}
public void test_AscendingSubMapEntrySet_tailSet() {
Set entrySet, tailSet;
NavigableSet ascendingSubMapEntrySet;
Iterator iterator, tailSetIterator;
Entry entry;
int value;
entrySet = navigableMap_startExcluded_endExcluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = entrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
tailSet = ascendingSubMapEntrySet.tailSet(entry);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(109, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, false);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(109, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, true);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue(); tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(109, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
}
}
entrySet = navigableMap_startExcluded_endIncluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = entrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
tailSet = ascendingSubMapEntrySet.tailSet(entry);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(110, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, false);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(110, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, true);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue(); tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(110, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
}
}
entrySet = navigableMap_startIncluded_endExcluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = entrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
tailSet = ascendingSubMapEntrySet.tailSet(entry);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(109, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, false);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(109, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, true);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue(); tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(109, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
}
}
entrySet = navigableMap_startIncluded_endIncluded.entrySet();
if (entrySet instanceof NavigableSet) {
ascendingSubMapEntrySet = (NavigableSet) entrySet;
iterator = entrySet.iterator();
while (iterator.hasNext()) {
entry = (Entry) iterator.next();
tailSet = ascendingSubMapEntrySet.tailSet(entry);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(110, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, false);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue() + 1; tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());
}
assertEquals(110, value);
try {
tailSetIterator.next();
fail("should throw NoSuchElementException");
} catch (NoSuchElementException e) {
// Expected
}
tailSet = ascendingSubMapEntrySet.tailSet(entry, true);
tailSetIterator = tailSet.iterator();
for (value = (Integer) entry.getValue(); tailSetIterator
.hasNext(); value++) {
assertEquals(value, ((Entry) tailSetIterator.next())
.getValue());