protected Description matchNewClassOrMethodInvocation(ExpressionTree tree, VisitorState state) {
    Description description = checkClosed(tree, state);
    if (description == NO_MATCH) {
      return NO_MATCH;
    }
    if (AbstractReturnValueIgnored.expectedExceptionTest(tree, state)
        || MOCKITO_MATCHER.matches(state.getPath().getParentPath().getLeaf(), state)) {
      return NO_MATCH;
    }
    return description;
  }
protected Description matchNewClassOrMethodInvocation ( ExpressionTree tree , VisitorState state ) { Description description = checkClosed ( tree , state ) ; if ( description == NO_MATCH ) { return NO_MATCH ; } if ( AbstractReturnValueIgnored . expectedExceptionTest ( tree , state ) || MOCKITO_MATCHER . matches ( state . getPath ( ) . getParentPath ( ) . getLeaf ( ) , state ) ) { return NO_MATCH ; } return description ; }
Check that constructors and methods annotated with {@link MustBeClosed} occur within the
resource variable initializer of a try-with-resources statement.