apt-mirror-api/src/main/java/com/sun/mirror/util/DeclarationFilter.java
public <D extends Declaration> Collection<D> filter(Collection<D> decls) {
		ArrayList<D> res = new ArrayList<D>(decls.size());
		for (D d : decls) {
			if (matches(d)) {
				res.add(d);
			}
		}
		return res;
	}
public <D extends Declaration> Collection<D> filter(Collection<D> decls) {
		ArrayList<D> res = new ArrayList<D>(decls.size());
		for (D d : decls) {
			if (matches(d)) {
				res.add(d);
			}
		}
		return res;
	}
public < D extends Declaration > Collection < D > filter ( Collection < D > decls ) { ArrayList < D > res = new ArrayList < D > ( decls . size ( ) ) ; for ( D d : decls ) { if ( matches ( d ) ) { res . add ( d ) ; } } return res ; }
Returns the declarations matched by this filter.
The result is a collection of the same type as the argument;
the {@linkplain #filter(Collection, Class) two-parameter version}
of <tt>filter</tt> offers control over the result type.

@param <D>   type of the declarations being filtered
@param decls declarations being filtered
@return the declarations matched by this filter
Returns the declarations matched by this filter . The result is a collection of the same type as the argument ; the { @linkplain #filter ( Collection Class ) two - parameter version } of <tt > filter< / tt > offers control over the result type .