MCPcopy Index your code
hub / github.com/jankotek/mapdb / testRemoveElement

Method testRemoveElement

src/test/java/org/mapdb/BTreeSet2Test.java:283–299  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281 * remove(x) removes x and returns true if present
282 */
283 public void testRemoveElement() {
284 NavigableSet q = populatedSet(SIZE);
285 for (int i = 1; i < SIZE; i+=2) {
286 assertTrue(q.contains(i));
287 assertTrue(q.remove(i));
288 assertFalse(q.contains(i));
289 assertTrue(q.contains(i-1));
290 }
291 for (int i = 0; i < SIZE; i+=2) {
292 assertTrue(q.contains(i));
293 assertTrue(q.remove(i));
294 assertFalse(q.contains(i));
295 assertFalse(q.remove(i + 1));
296 assertFalse(q.contains(i + 1));
297 }
298 assertTrue(q.isEmpty());
299 }
300
301 /*
302 * contains(x) reports true when elements added but not yet removed

Callers

nothing calls this directly

Calls 4

populatedSetMethod · 0.95
containsMethod · 0.45
removeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected