/** * Matches a type by a another matcher that is applied on any of its declared methods. * * @param matcher The matcher that is applied onto each declared method. * @param <T> The type of the matched object. * @return A matcher that matches any type where another matcher is matched positively on at least on declared methods. */ public static <T extends TypeDefinition> ElementMatcher.Junction<T> declaresMethod(ElementMatcher<? super MethodDescription> matcher) { return new DeclaringMethodMatcher<T>(new CollectionItemMatcher<MethodDescription>(matcher)); }