ClassFieldCountCheck extends IssuableSubscriptionVisitor { public void setCountNonPublicFields(boolean countNonPublicFields) { this.countNonPublicFields = countNonPublicFields; }  @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 count_only_public_fields() { ClassFieldCountCheck check = new ClassFieldCountCheck(); check.setCountNonPublicFields(false); JavaCheckVerifier.newVerifier() .onFile(TEST_FILES_DIR + "CountOnlyPublicFields.java") .withCheck(check) .verifyIssues(); }