int
5253545556575859606162
* and negates the predicate. */ @Override public int retainAll(final IntPredicate predicate) { return removeAll(new IntPredicate() { public boolean apply(int value) { return !predicate.apply(value); };
1718192021222324252627
@Override public int removeAll(final IntLookupContainer c) { // We know c holds sub-types of int and we're not modifying c, so go unchecked. final IntContainer c2 = (IntContainer) c; return this.removeAll(new IntPredicate() { public boolean apply(int k) { return c2.contains(k); }
3536373839404142434445
@Override public int retainAll(final IntLookupContainer c) { // We know c holds sub-types of int and we're not modifying c, so go unchecked. final IntContainer c2 = (IntContainer) c; return this.removeAll(new IntPredicate() { public boolean apply(int k) { return !c2.contains(k); }
5152535455565758596061
379380381382383384385386387388389
} @Override public int retainAll(final IntPredicate predicate) { return removeAll(new IntPredicate() { public boolean apply(int value) { return !predicate.apply(value); };
149150151152153154155156157158159
expected[j++] = i; } assertArrayEquals(expected, setIndexes); // Test for-each predicates. ilc.forEach(new IntPredicate() { int i = jre.nextSetBit(0); public boolean apply(int setBit) { assertEquals(i, setBit);
138139140141142143144145146147148
@Test public void testRemoveAllWithPredicate() { set.add(0, key1, key2); assertEquals(1, set.removeAll(new IntPredicate() { public boolean apply(int v) { return v == key1; };
155156157158159160161162163164165
@Test public void testRetainAllWithPredicate() { set.add(0, key1, key2, 3, 4, 5); assertEquals(4, set.retainAll(new IntPredicate() { public boolean apply(int v) { return v == key1 || v == key2; };
1819202122232425262728
3637383940414243444546