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

Method testRemoveElement

src/test/java/org/mapdb/BTreeSet3Test.java:236–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

234 * remove(x) removes x and returns true if present
235 */
236 public void testRemoveElement() {
237 NavigableSet q = populatedSet(SIZE);
238 for (int i = 1; i < SIZE; i+=2) {
239 assertTrue(q.contains(i));
240 assertTrue(q.remove(i));
241 assertFalse(q.contains(i));
242 assertTrue(q.contains(i-1));
243 }
244 for (int i = 0; i < SIZE; i+=2) {
245 assertTrue(q.contains(i));
246 assertTrue(q.remove(i));
247 assertFalse(q.contains(i));
248 assertFalse(q.remove(i+1));
249 assertFalse(q.contains(i+1));
250 }
251 assertTrue(q.isEmpty());
252 }
253
254 /*
255 * 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