MCPcopy Create free account
hub / github.com/antlr/codebuff / retainAll

Method retainAll

corpus/java/training/guava/collect/Iterators.java:260–263  ·  view source on GitHub ↗

Traverses an iterator and removes every element that does not belong to the provided collection. The iterator will be left exhausted: its hasNext() method will return false. @param removeFrom the iterator to (potentially) remove elements from @param elementsToRetain the elements to

(Iterator<?> removeFrom, Collection<?> elementsToRetain)

Source from the content-addressed store, hash-verified

258 * @return {@code true} if any element was removed from {@code iterator}
259 */
260 @CanIgnoreReturnValue
261 public static boolean retainAll(Iterator<?> removeFrom, Collection<?> elementsToRetain) {
262 return removeIf(removeFrom, not(in(elementsToRetain)));
263 }
264
265 /**
266 * Determines whether two iterators contain equal elements in the same order.

Callers 3

retainAllMethod · 0.95
retainAllMethod · 0.95
standardRetainAllMethod · 0.95

Calls 3

removeIfMethod · 0.95
notMethod · 0.45
inMethod · 0.45

Tested by

no test coverage detected