ClassFieldCountCheck extends IssuableSubscriptionVisitor { public void setThreshold(int threshold) { this.threshold = threshold; }  @Override List<Tree.Kind> nodesToVisit(); @Override void visitNode(Tree tree); void setThreshold(int threshold); void setCountNonPublicFields(boolean countNonPublicFields); @RuleProperty(key = "countNonpublicFields", description = "Whether or not to include non-fields in the count", defaultValue = "" + DEFAULT_COUNT_NON_PUBLIC_FIELDS)
  private boolean countNonPublicFields; }
@Test void enums_interfaces_and_anonymous_trees() { ClassFieldCountCheck check = new ClassFieldCountCheck(); check.setThreshold(2); JavaCheckVerifier.newVerifier() .onFile(TEST_FILES_DIR + "UnusualTrees.java") .withCheck(check) .verifyIssues(); }