apt-mirror-api/src/main/java/com/sun/mirror/util/DeclarationFilter.java
public <D extends Declaration> Collection<D>
	filter(Collection<? extends Declaration> decls, Class<D> resType) {
		ArrayList<D> res = new ArrayList<D>(decls.size());
		for (Declaration d : decls) {
			if (resType.isInstance(d) && matches(d)) {
				res.add(resType.cast(d));
			}
		}
		return res;
	}
public <D extends Declaration> Collection<D>
	filter(Collection<? extends Declaration> decls, Class<D> resType) {
		ArrayList<D> res = new ArrayList<D>(decls.size());
		for (Declaration d : decls) {
			if (resType.isInstance(d) && matches(d)) {
				res.add(resType.cast(d));
			}
		}
		return res;
	}
Returns the declarations matched by this filter, with the result
being restricted to declarations of a given kind.
Similar to the simpler
{@linkplain #filter(Collection) single-parameter version}
of <tt>filter</tt>, but the result type is specified explicitly.

@param <D>     type of the declarations being returned
@param decls   declarations being filtered
@param resType type of the declarations being returned --
the reflective view of <tt>D</tt>
@return the declarations matched by this filter, restricted to those
of the specified type