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

Method testRetainAll

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

Source from the content-addressed store, hash-verified

295 * retainAll(c) retains only those elements of c and reports true if changed
296 */
297 public void testRetainAll() {
298 NavigableSet q = populatedSet(SIZE);
299 NavigableSet p = populatedSet(SIZE);
300 for (int i = 0; i < SIZE; ++i) {
301 boolean changed = q.retainAll(p);
302 if (i == 0)
303 assertFalse(changed);
304 else
305 assertTrue(changed);
306
307 assertTrue(q.containsAll(p));
308 assertEquals(SIZE-i, q.size());
309 p.pollFirst();
310 }
311 }
312
313 /*
314 * removeAll(c) removes only those elements of c and reports true if changed

Callers

nothing calls this directly

Calls 5

populatedSetMethod · 0.95
containsAllMethod · 0.80
pollFirstMethod · 0.80
retainAllMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected