CommentRegularExpressionCheck extends SubscriptionVisitorCheck { public void setRegularExpression(String regularExpression) { this.regularExpression = regularExpression; init(); }  void init(); void setMessage(String message); void setRegularExpression(String regularExpression); @Override void visitNode(Tree tree); @Override Set<Kind> nodesToVisit(); @RuleProperty(
            key = "regularExpression",
            description = "regular expression",
            defaultValue = "" + DEFAULT_REGULAR_EXPRESSION)
    public String regularExpression; @RuleProperty(
            key = "message",
            description = "The issue message",
            defaultValue = "" + DEFAULT_MESSAGE)
    public String message; }
@Test public void exception() { CommentRegularExpressionCheck check = new CommentRegularExpressionCheck(); try { check.setRegularExpression("[abc"); } catch (IllegalStateException e) { assertThat(e.getMessage()).isEqualTo("Unable to compile regular expression: [abc"); } }