/** * Matches all class loaders in the hierarchy of the matched class loader against a given matcher. * * @param matcher The matcher to apply to all class loaders in the hierarchy of the matched class loader. * @param <T> The type of the matched object. * @return A matcher that matches all class loaders in the hierarchy of the matched class loader. */ public static <T extends ClassLoader> ElementMatcher.Junction<T> hasChild(ElementMatcher<? super ClassLoader> matcher) { return new ClassLoaderHierarchyMatcher<T>(matcher); }