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

Method testRetainAll

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

Source from the content-addressed store, hash-verified

342 * retainAll(c) retains only those elements of c and reports true if changed
343 */
344 public void testRetainAll() {
345 NavigableSet q = populatedSet(SIZE);
346 NavigableSet p = populatedSet(SIZE);
347 for (int i = 0; i < SIZE; ++i) {
348 boolean changed = q.retainAll(p);
349 if (i == 0)
350 assertFalse(changed);
351 else
352 assertTrue(changed);
353
354 assertTrue(q.containsAll(p));
355 assertEquals(SIZE-i, q.size());
356 p.pollFirst();
357 }
358 }
359
360 /*
361 * 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