public static Matcher < ClassTree > hasMethod ( final Matcher < MethodTree > methodMatcher ) { return new Matcher < ClassTree > ( ) { @ Override public boolean matches ( ClassTree t , VisitorState state ) { for ( Tree member : t . getMembers ( ) ) { if ( member instanceof MethodTree ) { if ( methodMatcher . matches ( ( MethodTree ) member , state ) ) { return true ; } } } return false ; } } ; }
Matches a class in which at least one method matches the given methodMatcher .