}
}
public void testPreviousKey() {
resetEmpty();
OrderedBidiMap bidi = (OrderedBidiMap) map;
assertEquals(null, bidi.previousKey(getOtherKeys()[0]));
if (isAllowNullKey() == false) {
try {
assertEquals(null, bidi.previousKey(null)); // this is allowed too
} catch (NullPointerException ex) {
}
} else {
assertEquals(null, bidi.previousKey(null));
}
resetFull();
bidi = (OrderedBidiMap) map;
List list = new ArrayList(confirmed.keySet());
Collections.reverse(list);
Iterator it = list.iterator();
Object confirmedLast = it.next();
while (it.hasNext()) {
Object confirmedObject = it.next();
assertEquals(confirmedObject, bidi.previousKey(confirmedLast));
confirmedLast = confirmedObject;
}
assertEquals(null, bidi.previousKey(confirmedLast));
if (isAllowNullKey() == false) {
try {
bidi.previousKey(null);
fail();
} catch (NullPointerException ex) {
}
} else {
assertEquals(null, bidi.previousKey(null));
}
}