/** * Matches any class loader that is either the given class loader or a parent of the given class loader. * * @param classLoader The class loader of which parent class loaders are matched. * @param <T> The type of the matched object. * @return A matcher that matches the given class loader and any class loader that is a parent of the given * class loader. */ public static <T extends ClassLoader> ElementMatcher.Junction<T> isParentOf(ClassLoader classLoader) { return classLoader == BOOTSTRAP_CLASSLOADER ? ElementMatchers.<T>isBootstrapClassLoader() : new ClassLoaderParentMatcher<T>(classLoader); }