development/checkstyle/src/com/android/support/checkstyle/TestSizeAnnotationCheck.java
private boolean isJUnit4Runner(DetailAST ast) {
        DetailAST runner = AnnotationUtility.getAnnotation(ast, RUN_WITH);

        // We make an assumption that @RunWith annotation will have this structure:
        //      @RunWith
        //         |
        //        EXPR
        //          |
        //    -----DOT-------
        //  /                \
        // Runner name     class

        if (runner == null // There is no @RunWith annotation
                || runner.findFirstToken(TokenTypes.EXPR) == null // Annotation has no value.
                || runner.findFirstToken(TokenTypes.EXPR).getFirstChild() == null
                || runner.findFirstToken(TokenTypes.EXPR).getFirstChild().getFirstChild() == null) {
            return false;
        }
        return JUNIT4.equals(
                runner.findFirstToken(TokenTypes.EXPR).getFirstChild().getFirstChild().getText());
    }
/**
     * Checks whether this test class is annotated with @RunWith(JUnit4.class).
     */
Checks whether this test class is annotated with @RunWith(JUnit4.class).
Checks whether this test class is annotated with @RunWith ( JUnit4 . class ) .
private boolean isJUnit4Runner(DetailAST ast) {
        DetailAST runner = AnnotationUtility.getAnnotation(ast, RUN_WITH);
        if (runner == null 
                || runner.findFirstToken(TokenTypes.EXPR) == null 
                || runner.findFirstToken(TokenTypes.EXPR).getFirstChild() == null
                || runner.findFirstToken(TokenTypes.EXPR).getFirstChild().getFirstChild() == null) {
            return false;
        }
        return JUNIT4.equals(
                runner.findFirstToken(TokenTypes.EXPR).getFirstChild().getFirstChild().getText());
    }
private boolean isJUnit4Runner ( DetailAST ast ) { DetailAST runner = AnnotationUtility . getAnnotation ( ast , RUN_WITH ) ; if ( runner == null || runner . findFirstToken ( TokenTypes . EXPR ) == null || runner . findFirstToken ( TokenTypes . EXPR ) . getFirstChild ( ) == null || runner . findFirstToken ( TokenTypes . EXPR ) . getFirstChild ( ) . getFirstChild ( ) == null ) { return false ; } return JUNIT4 . equals ( runner . findFirstToken ( TokenTypes . EXPR ) . getFirstChild ( ) . getFirstChild ( ) . getText ( ) ) ; }
Checks whether this test class is annotated with @RunWith(JUnit4.class).
Checks whether this test class is annotated with @RunWith ( JUnit4 . class ) .
// We make an assumption that @RunWith annotation will have this structure: //      @RunWith //         | //        EXPR //          | //    -----DOT------- //  /                \ // Runner name     class // There is no @RunWith annotation // Annotation has no value.