Java Code Examples for java.util.concurrent.ConcurrentSkipListMap#pollFirstEntry()
The following examples show how to use
java.util.concurrent.ConcurrentSkipListMap#pollFirstEntry() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConcurrentSkipListMapTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * pollFirstEntry returns entries in order */ public void testPollFirstEntry() { ConcurrentSkipListMap map = map5(); Map.Entry e = map.pollFirstEntry(); assertEquals(one, e.getKey()); assertEquals("A", e.getValue()); e = map.pollFirstEntry(); assertEquals(two, e.getKey()); map.put(one, "A"); e = map.pollFirstEntry(); assertEquals(one, e.getKey()); assertEquals("A", e.getValue()); e = map.pollFirstEntry(); assertEquals(three, e.getKey()); map.remove(four); e = map.pollFirstEntry(); assertEquals(five, e.getKey()); try { e.setValue("A"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollFirstEntry(); assertNull(e); }
Example 2
Source File: ConcurrentSkipListMapTest.java From j2objc with Apache License 2.0 | 6 votes |
/** * pollFirstEntry returns entries in order */ public void testPollFirstEntry() { ConcurrentSkipListMap map = map5(); Map.Entry e = map.pollFirstEntry(); assertEquals(one, e.getKey()); assertEquals("A", e.getValue()); e = map.pollFirstEntry(); assertEquals(two, e.getKey()); map.put(one, "A"); e = map.pollFirstEntry(); assertEquals(one, e.getKey()); assertEquals("A", e.getValue()); e = map.pollFirstEntry(); assertEquals(three, e.getKey()); map.remove(four); e = map.pollFirstEntry(); assertEquals(five, e.getKey()); try { e.setValue("A"); shouldThrow(); } catch (UnsupportedOperationException success) {} e = map.pollFirstEntry(); assertNull(e); }