use of java.util.NavigableMap in project mapdb by jankotek.
the class TreeSubMapTest method testDescendingClear.
/**
* clear removes all pairs
*/
public void testDescendingClear() {
NavigableMap map = dmap5();
map.clear();
assertEquals(0, map.size());
}
use of java.util.NavigableMap in project mapdb by jankotek.
the class TreeSubMapTest method testFloorEntry.
/**
* floorEntry returns preceding entry.
*/
public void testFloorEntry() {
NavigableMap map = map5();
Map.Entry e1 = map.floorEntry(three);
assertEquals(three, e1.getKey());
Map.Entry e2 = map.floorEntry(six);
assertEquals(five, e2.getKey());
Map.Entry e3 = map.floorEntry(one);
assertEquals(one, e3.getKey());
Map.Entry e4 = map.floorEntry(zero);
assertNull(e4);
}
use of java.util.NavigableMap in project mapdb by jankotek.
the class TreeSubMapTest method testGet.
/**
* get returns the correct element at the given key,
* or null if not present
*/
public void testGet() {
NavigableMap map = map5();
assertEquals("A", (String) map.get(one));
NavigableMap empty = map0();
assertNull(empty.get(one));
}
use of java.util.NavigableMap in project mapdb by jankotek.
the class TreeSubMapTest method testIsEmpty.
/**
* isEmpty is true of empty map and false for non-empty
*/
public void testIsEmpty() {
NavigableMap empty = map0();
NavigableMap map = map5();
assertTrue(empty.isEmpty());
assertFalse(map.isEmpty());
}
use of java.util.NavigableMap in project mapdb by jankotek.
the class TreeSubMapTest method testRemove1_NullPointerException.
/**
* remove(null) throws NPE
*/
public void testRemove1_NullPointerException() {
NavigableMap c = map5();
try {
c.remove(null);
shouldThrow();
} catch (NullPointerException success) {
}
}
Aggregations