TrailingCommentsCheck extends SubscriptionVisitorCheck { public void setLegalCommentPattern(String pattern) { this.legalCommentPattern = pattern; }  @Override Set<Tree.Kind> nodesToVisit(); @Override void visitFile(Tree tree); @Override void visitNode(Tree tree); void setLegalCommentPattern(String pattern);  }
@Test public void withoutPattern(){ TrailingCommentsCheck check = new TrailingCommentsCheck(); check.setLegalCommentPattern(""); EsqlCheckVerifier.issues(check, new File("src/test/resources/trailingComments.esql")) .next().atLine(8).withMessage("Move this trailing comment on the previous empty line.") .next().atLine(15).withMessage("Move this trailing comment on the previous empty line.") .next().atLine(18).withMessage("Move this trailing comment on the previous empty line.") .next().atLine(20).withMessage("Move this trailing comment on the previous empty line.") .next().atLine(23).withMessage("Move this trailing comment on the previous empty line.") .noMore(); }