use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testValues.
/**
* values collection contains all values
*/
public void testValues() {
ConcurrentSkipListMap map = map5();
Collection s = map.values();
assertEquals(5, s.size());
assertTrue(s.contains("A"));
assertTrue(s.contains("B"));
assertTrue(s.contains("C"));
assertTrue(s.contains("D"));
assertTrue(s.contains("E"));
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testFloorKey.
/**
* floorKey returns preceding element
*/
public void testFloorKey() {
ConcurrentSkipListMap q = map5();
Object e1 = q.floorKey(three);
assertEquals(three, e1);
Object e2 = q.floorKey(six);
assertEquals(five, e2);
Object e3 = q.floorKey(one);
assertEquals(one, e3);
Object e4 = q.floorKey(zero);
assertNull(e4);
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testFirstKey.
/**
* firstKey returns first key
*/
public void testFirstKey() {
ConcurrentSkipListMap map = map5();
assertEquals(one, map.firstKey());
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testDescendingEntrySet.
/**
* descendingEntrySet contains all pairs
*/
public void testDescendingEntrySet() {
ConcurrentSkipListMap map = map5();
Set s = map.descendingMap().entrySet();
assertEquals(5, s.size());
Iterator it = s.iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry) it.next();
assertTrue((e.getKey().equals(one) && e.getValue().equals("A")) || (e.getKey().equals(two) && e.getValue().equals("B")) || (e.getKey().equals(three) && e.getValue().equals("C")) || (e.getKey().equals(four) && e.getValue().equals("D")) || (e.getKey().equals(five) && e.getValue().equals("E")));
}
}
use of java.util.concurrent.ConcurrentSkipListMap in project j2objc by google.
the class ConcurrentSkipListMapTest method testConstructFromSorted.
/**
* copy constructor creates map equal to source map
*/
public void testConstructFromSorted() {
ConcurrentSkipListMap map = map5();
ConcurrentSkipListMap map2 = new ConcurrentSkipListMap(map);
assertEquals(map, map2);
}
Aggregations