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

Method filter

output/java_guava/1.4.16/Collections2.java:90–97  ·  view source on GitHub ↗
(Collection<E> unfiltered, Predicate<? super E> predicate)

Source from the content-addressed store, hash-verified

88
89
90 public static <E> Collection<E> filter(Collection<E> unfiltered, Predicate<? super E> predicate) {
91 if (unfiltered instanceof FilteredCollection) {
92 // Support clear(), removeAll(), and retainAll() when filtering a filtered
93 // collection.
94 return ((FilteredCollection<E>) unfiltered).createCombined(predicate);
95 }
96 return new FilteredCollection<E>(checkNotNull(unfiltered), checkNotNull(predicate));
97 }
98
99 /**
100 * Delegates to {@link Collection#contains}. Returns {@code false} if the

Callers 3

filterCollectionMethod · 0.95
toStringMethod · 0.95
delegateMethod · 0.95

Calls 2

createCombinedMethod · 0.45
checkNotNullMethod · 0.45

Tested by

no test coverage detected