diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 0000000000..73e7600631 --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,58 @@ +name: On-demand integration test +on: + # run action every time a new comment is created + issue_comment: + types: [ created ] + # enable this, to test the action without changing default branch + push: + branches: [ gdejong/integration-test-action ] + +permissions: + contents: read +jobs: + on_demand_integration_test: + name: On-demand integration test + # Only run the integration test if the created comment is on a pull request + # and contains the string `/integration-test` + # disable this to avoid having to change the default branch on EPS + # if: | + # github.event.issue.pull_request && + # contains(github.event.comment.body, '/integration-test') + # XXX TODO: Device matrix? + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1 + with: + submodules: 'recursive' + # ensure we fetch ALL commits and tags! + fetch-depth: '0' + persist-credentials: false + - name: Set git config + run: | + git config --global user.email "cody@picnic.tech" + git config --global user.name "cody" + - name: Set up JDK + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 + with: + # XXX TODO: java version matrix? + java-version: 17.0.8 + distribution: temurin + cache: maven + - name: Display build environment details + run: mvn --version + - name: Display grep version + run: grep --version + - name: Install error-prone-support snapshot + run: mvn -T1C install -DskipTests -Dverification.skip + - name: Run integration test + # ensure this script is executed in the integration-tests directory + working-directory: ./integration-tests + run: bash ./run.sh + - name: Upload diff artifacts + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + with: + name: integration-test-diffs + path: | + ./integration-tests/checkstyle-checkstyle-10.9.3-expected-changes.patch + ./integration-tests/checkstyle-checkstyle-10.9.3-expected-warnings.txt diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..30230be4ae --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "integration-tests/checkstyle"] + path = integration-tests/checkstyle + url = git@github.com:checkstyle/checkstyle.git diff --git a/integration-tests/checkstyle b/integration-tests/checkstyle new file mode 160000 index 0000000000..7b8d368e13 --- /dev/null +++ b/integration-tests/checkstyle @@ -0,0 +1 @@ +Subproject commit 7b8d368e130ebd3623838db1c24ecc93bcdd7d29 diff --git a/integration-tests/checkstyle-checkstyle-10.9.3-expected-changes.patch b/integration-tests/checkstyle-checkstyle-10.9.3-expected-changes.patch new file mode 100644 index 0000000000..54db82124c --- /dev/null +++ b/integration-tests/checkstyle-checkstyle-10.9.3-expected-changes.patch @@ -0,0 +1,54939 @@ +diff --git a/src/it/java/com/google/checkstyle/test/base/AbstractIndentationTestSupport.java b/src/it/java/com/google/checkstyle/test/base/AbstractIndentationTestSupport.java +index 8ebfadaf1..02750fbf0 100644 +--- a/src/it/java/com/google/checkstyle/test/base/AbstractIndentationTestSupport.java ++++ b/src/it/java/com/google/checkstyle/test/base/AbstractIndentationTestSupport.java +@@ -19,10 +19,12 @@ + + package com.google.checkstyle.test.base; + ++import static com.google.common.base.Preconditions.checkState; ++import static java.nio.charset.StandardCharsets.UTF_8; ++ + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.BufferedReader; + import java.io.IOException; +-import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.nio.file.Paths; + import java.util.ArrayList; +@@ -71,8 +73,7 @@ public abstract class AbstractIndentationTestSupport extends AbstractGoogleModul + private static Integer[] getLinesWithWarnAndCheckComments(String aFileName, final int tabWidth) + throws IOException { + final List result = new ArrayList<>(); +- try (BufferedReader br = +- Files.newBufferedReader(Paths.get(aFileName), StandardCharsets.UTF_8)) { ++ try (BufferedReader br = Files.newBufferedReader(Paths.get(aFileName), UTF_8)) { + int lineNumber = 1; + for (String line = br.readLine(); line != null; line = br.readLine()) { + final Matcher match = LINE_WITH_COMMENT_REGEX.matcher(line); +@@ -81,30 +82,28 @@ public abstract class AbstractIndentationTestSupport extends AbstractGoogleModul + final int indentInComment = getIndentFromComment(comment); + final int actualIndent = getLineStart(line, tabWidth); + +- if (actualIndent != indentInComment) { +- throw new IllegalStateException( +- String.format( +- Locale.ROOT, +- "File \"%1$s\" has incorrect indentation in comment." +- + "Line %2$d: comment:%3$d, actual:%4$d.", +- aFileName, +- lineNumber, +- indentInComment, +- actualIndent)); +- } ++ checkState( ++ actualIndent == indentInComment, ++ String.format( ++ Locale.ROOT, ++ "File \"%1$s\" has incorrect indentation in comment." ++ + "Line %2$d: comment:%3$d, actual:%4$d.", ++ aFileName, ++ lineNumber, ++ indentInComment, ++ actualIndent)); + + if (isWarnComment(comment)) { + result.add(lineNumber); + } + +- if (!isCommentConsistent(comment)) { +- throw new IllegalStateException( +- String.format( +- Locale.ROOT, +- "File \"%1$s\" has inconsistent comment on line %2$d", +- aFileName, +- lineNumber)); +- } ++ checkState( ++ isCommentConsistent(comment), ++ String.format( ++ Locale.ROOT, ++ "File \"%1$s\" has inconsistent comment on line %2$d", ++ aFileName, ++ lineNumber)); + } else if (NONEMPTY_LINE_REGEX.matcher(line).matches()) { + throw new IllegalStateException( + String.format( +diff --git a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java +index 363c8ce9e..37ef4117e 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule21filename/OuterTypeFilenameTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { ++final class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOuterTypeFilename1() throws Exception { ++ void outerTypeFilename1() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("OuterTypeFilename"); +@@ -46,7 +46,7 @@ public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOuterTypeFilename2() throws Exception { ++ void outerTypeFilename2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("OuterTypeFilename"); +@@ -57,7 +57,7 @@ public class OuterTypeFilenameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOuterTypeFilename3() throws Exception { ++ void outerTypeFilename3() throws Exception { + final String[] expected = { + "3:1: " + getCheckMessage(OuterTypeFilenameCheck.class, MSG_KEY), + }; +diff --git a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java +index 2292146ef..ccf706555 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule231filetab/FileTabCharacterTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck; + import org.junit.jupiter.api.Test; + +-public class FileTabCharacterTest extends AbstractGoogleModuleTestSupport { ++final class FileTabCharacterTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class FileTabCharacterTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testFileTab() throws Exception { ++ void fileTab() throws Exception { + final String[] expected = { + "8:25: " + getCheckMessage(FileTabCharacterCheck.class, "containsTab"), + "51:5: " + getCheckMessage(FileTabCharacterCheck.class, "containsTab"), +diff --git a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java +index bca63aeae..a8e0a4035 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule232specialescape/IllegalTokenTextTest.java +@@ -23,7 +23,7 @@ import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.Configuration; + import org.junit.jupiter.api.Test; + +-public class IllegalTokenTextTest extends AbstractGoogleModuleTestSupport { ++final class IllegalTokenTextTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class IllegalTokenTextTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testIllegalTokens() throws Exception { ++ void illegalTokens() throws Exception { + final String message = + "Consider using special escape sequence instead of octal value or " + + "Unicode escaped value."; +diff --git a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java +index d3d412111..12e85315c 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter2filebasic/rule233nonascii/AvoidEscapedUnicodeCharactersTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck; + import org.junit.jupiter.api.Test; + +-public class AvoidEscapedUnicodeCharactersTest extends AbstractGoogleModuleTestSupport { ++final class AvoidEscapedUnicodeCharactersTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class AvoidEscapedUnicodeCharactersTest extends AbstractGoogleModuleTestS + } + + @Test +- public void testUnicodeEscapes() throws Exception { ++ void unicodeEscapes() throws Exception { + final String[] expected = { + "5:42: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), + "15:38: " + getCheckMessage(AvoidEscapedUnicodeCharactersCheck.class, MSG_KEY), +diff --git a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java +index e3ddeebe9..43279fd7d 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule32packagestate/LineLengthTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck; + import org.junit.jupiter.api.Test; + +-public class LineLengthTest extends AbstractGoogleModuleTestSupport { ++final class LineLengthTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class LineLengthTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testLineLength() throws Exception { ++ void lineLength() throws Exception { + final String[] expected = { + "5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 112), + "29: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 183), +diff --git a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java +index a8d38e92b..9b1d28403 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule331nowildcard/AvoidStarImportTest.java +@@ -23,7 +23,7 @@ import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.Configuration; + import org.junit.jupiter.api.Test; + +-public class AvoidStarImportTest extends AbstractGoogleModuleTestSupport { ++final class AvoidStarImportTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class AvoidStarImportTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testStarImport() throws Exception { ++ void starImport() throws Exception { + final String[] expected = { + "3:15: Using the '.*' form of import should be avoided - java.io.*.", + "4:17: Using the '.*' form of import should be avoided - java.lang.*.", +diff --git a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java +index 87b836716..cbf66dd84 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule332nolinewrap/NoLineWrapTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { ++final class NoLineWrapTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testBadLineWrap() throws Exception { ++ void badLineWrap() throws Exception { + final String[] expected = { + "1:1: " + getCheckMessage(NoLineWrapCheck.class, "no.line.wrap", "package"), + "6:1: " + getCheckMessage(NoLineWrapCheck.class, "no.line.wrap", "import"), +@@ -49,7 +49,7 @@ public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testGoodLineWrap() throws Exception { ++ void goodLineWrap() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("NoLineWrap"); +@@ -60,7 +60,7 @@ public class NoLineWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void goodLineLength() throws Exception { ++ void goodLineLength() throws Exception { + final int maxLineLength = 100; + final String[] expected = { + "5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", maxLineLength, 112), +diff --git a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java +index 93c557e7f..f22129778 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule333orderingandspacing/CustomImportOrderTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { ++final class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + + /** Shortcuts to make code more compact. */ + private static final String MSG_LINE_SEPARATOR = CustomImportOrderCheck.MSG_LINE_SEPARATOR; +@@ -45,7 +45,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCustomImport1() throws Exception { ++ void customImport1() throws Exception { + final String[] expected = { + "4:1: " + + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), +@@ -68,7 +68,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCustomImport2() throws Exception { ++ void customImport2() throws Exception { + final String[] expected = { + "4:1: " + + getCheckMessage(clazz, MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), +@@ -113,7 +113,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCustomImport3() throws Exception { ++ void customImport3() throws Exception { + final String[] expected = { + "4:1: " + getCheckMessage(clazz, MSG_LINE_SEPARATOR, "java.awt.Dialog"), + "5:1: " +@@ -155,7 +155,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCustomImport4() throws Exception { ++ void customImport4() throws Exception { + final String[] expected = { + "7:1: " + getCheckMessage(clazz, MSG_SEPARATED_IN_GROUP, "javax.swing.WindowConstants.*"), + "15:1: " + getCheckMessage(clazz, MSG_SEPARATED_IN_GROUP, "java.util.StringTokenizer"), +@@ -172,7 +172,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCustomImport5() throws Exception { ++ void customImport5() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(clazz, MSG_SEPARATED_IN_GROUP, "javax.swing.WindowConstants.*"), + "13:1: " +@@ -195,7 +195,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testValid() throws Exception { ++ void valid() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("CustomImportOrder"); +@@ -206,7 +206,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testValid2() throws Exception { ++ void valid2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("CustomImportOrder"); +@@ -217,7 +217,7 @@ public class CustomImportOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testValidGoogleStyleOrderOfImports() throws Exception { ++ void validGoogleStyleOrderOfImports() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("CustomImportOrder"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java +index 3fa2262f6..bdd1dde89 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule341onetoplevel/OneTopLevelClassTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { ++final class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testBad() throws Exception { ++ void bad() throws Exception { + final Class clazz = OneTopLevelClassCheck.class; + final String messageKey = "one.top.level.class"; + +@@ -54,7 +54,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testGood() throws Exception { ++ void good() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("OneTopLevelClass"); +@@ -65,7 +65,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testBad1() throws Exception { ++ void bad1() throws Exception { + final Class clazz = OneTopLevelClassCheck.class; + final String messageKey = "one.top.level.class"; + +@@ -82,7 +82,7 @@ public class OneTopLevelClassTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testBad2() throws Exception { ++ void bad2() throws Exception { + final Class clazz = OneTopLevelClassCheck.class; + final String messageKey = "one.top.level.class"; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java +index e44e0a257..14b95f115 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3421overloadsplit/OverloadMethodsDeclarationOrderTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck; + import org.junit.jupiter.api.Test; + +-public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTestSupport { ++final class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class OverloadMethodsDeclarationOrderTest extends AbstractGoogleModuleTes + } + + @Test +- public void testOverloadMethods() throws Exception { ++ void overloadMethods() throws Exception { + final Class clazz = + OverloadMethodsDeclarationOrderCheck.class; + final String messageKey = "overload.methods.declaration"; +diff --git a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java +index 21c199c47..aa413f957 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter3filestructure/rule3sourcefile/EmptyLineSeparatorTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck; + import org.junit.jupiter.api.Test; + +-public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { ++final class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparator() throws Exception { ++ void emptyLineSeparator() throws Exception { + final Class clazz = EmptyLineSeparatorCheck.class; + final String messageKey = "empty.line.separator"; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java +index 1e792faab..19da4f1f2 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule411bracesareused/NeedBracesTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck; + import org.junit.jupiter.api.Test; + +-public class NeedBracesTest extends AbstractGoogleModuleTestSupport { ++final class NeedBracesTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class NeedBracesTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testNeedBraces() throws Exception { ++ void needBraces() throws Exception { + final Class clazz = NeedBracesCheck.class; + final String messageKey = "needBraces"; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java +index 98a23b649..5da663513 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/LeftCurlyTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck; + import org.junit.jupiter.api.Test; + +-public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { ++final class LeftCurlyTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testLeftCurlyBraces() throws Exception { ++ void leftCurlyBraces() throws Exception { + final String[] expected = { + "4:1: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 1), + "7:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -53,7 +53,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testLeftCurlyAnnotations() throws Exception { ++ void leftCurlyAnnotations() throws Exception { + final String[] expected = { + "10:1: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 1), + "14:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -70,7 +70,7 @@ public class LeftCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testLeftCurlyMethods() throws Exception { ++ void leftCurlyMethods() throws Exception { + final String[] expected = { + "4:1: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 1), + "9:5: " + getCheckMessage(LeftCurlyCheck.class, MSG_KEY_LINE_PREVIOUS, "{", 5), +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java +index 485d0c742..83f55693b 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule412nonemptyblocks/RightCurlyTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class RightCurlyTest extends AbstractGoogleModuleTestSupport { ++final class RightCurlyTest extends AbstractGoogleModuleTestSupport { + + private static final String[] MODULES = { + "RightCurlySame", "RightCurlyAlone", +@@ -41,7 +41,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testRightCurly() throws Exception { ++ void rightCurly() throws Exception { + final String[] expected = { + "20:17: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 17), + "32:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), +@@ -58,7 +58,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testRightCurly2() throws Exception { ++ void rightCurly2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = createTreeWalkerConfig(getModuleConfigsByIds(MODULES)); +@@ -69,7 +69,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testRightCurlyLiteralDoDefault() throws Exception { ++ void rightCurlyLiteralDoDefault() throws Exception { + final String[] expected = { + "62:9: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 9), + "67:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), +@@ -84,7 +84,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testRightCurlyOther() throws Exception { ++ void rightCurlyOther() throws Exception { + final String[] expected = { + "20:17: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 17), + "32:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), +@@ -101,7 +101,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testRightCurlyLiteralDo() throws Exception { ++ void rightCurlyLiteralDo() throws Exception { + final String[] expected = { + "62:9: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 9), + "67:13: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_SAME, "}", 13), +@@ -116,7 +116,7 @@ public class RightCurlyTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testRightCurlySwitch() throws Exception { ++ void rightCurlySwitch() throws Exception { + final String[] expected = { + "12:24: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_ALONE, "}", 24), + "19:27: " + getCheckMessage(RightCurlyCheck.class, MSG_KEY_LINE_ALONE, "}", 27), +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java +index ef593a978..9bf2c6a4e 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyBlockTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck; + import org.junit.jupiter.api.Test; + +-public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { ++final class EmptyBlockTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEmptyBlock() throws Exception { ++ void emptyBlock() throws Exception { + final String[] expected = { + "19:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), + "22:34: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "if"), +@@ -77,7 +77,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEmptyBlockCatch() throws Exception { ++ void emptyBlockCatch() throws Exception { + final String[] expected = { + "29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), + "50:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java +index afadf322d..40941ff67 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule413emptyblocks/EmptyCatchBlockTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { ++final class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEmptyBlockCatch() throws Exception { ++ void emptyBlockCatch() throws Exception { + final String[] expected = { + "28:31: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), + "49:35: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), +@@ -50,7 +50,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testNoViolations() throws Exception { ++ void noViolations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("EmptyCatchBlock"); +@@ -61,7 +61,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testViolationsByComment() throws Exception { ++ void violationsByComment() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), + "28:18: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), +@@ -75,7 +75,7 @@ public class EmptyCatchBlockTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testViolationsByVariableName() throws Exception { ++ void violationsByVariableName() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), + "36:18: " + getCheckMessage(EmptyCatchBlockCheck.class, "catch.block.empty"), +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java +index 8e1218aad..52281f7be 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule43onestatement/OneStatementPerLineTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck; + import org.junit.jupiter.api.Test; + +-public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { ++final class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOneStatement() throws Exception { ++ void oneStatement() throws Exception { + final String msg = getCheckMessage(OneStatementPerLineCheck.class, "multiple.statements.line"); + + final String[] expected = { +@@ -67,7 +67,7 @@ public class OneStatementPerLineTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOneStatementNonCompilableInput() throws Exception { ++ void oneStatementNonCompilableInput() throws Exception { + final String msg = getCheckMessage(OneStatementPerLineCheck.class, "multiple.statements.line"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java +index 02beb92a0..c14e7147b 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule44columnlimit/LineLengthTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck; + import org.junit.jupiter.api.Test; + +-public class LineLengthTest extends AbstractGoogleModuleTestSupport { ++final class LineLengthTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class LineLengthTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testLineLength() throws Exception { ++ void lineLength() throws Exception { + final String[] expected = { + "5: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 112), + "29: " + getCheckMessage(LineLengthCheck.class, "maxLineLen", 100, 113), +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java +index 58537cae2..c4013d930 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/MethodParamPadTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck; + import org.junit.jupiter.api.Test; + +-public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { ++final class MethodParamPadTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOperatorWrap() throws Exception { ++ void operatorWrap() throws Exception { + final Class clazz = MethodParamPadCheck.class; + final String messageKeyPrevious = "line.previous"; + final String messageKeyPreceded = "ws.preceded"; +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java +index dd52c68a5..1284d415d 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/OperatorWrapTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck; + import org.junit.jupiter.api.Test; + +-public class OperatorWrapTest extends AbstractGoogleModuleTestSupport { ++final class OperatorWrapTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class OperatorWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOperatorWrap() throws Exception { ++ void operatorWrap() throws Exception { + final Class clazz = OperatorWrapCheck.class; + final String messageKey = "line.new"; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java +index 1fbed9cbb..cecfe12d8 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule451wheretobreak/SeparatorWrapTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck; + import org.junit.jupiter.api.Test; + +-public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { ++final class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testSeparatorWrapDot() throws Exception { ++ void separatorWrapDot() throws Exception { + final String[] expected = { + "28:30: " + getCheckMessage(SeparatorWrapCheck.class, "line.new", "."), + }; +@@ -47,7 +47,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testSeparatorWrapComma() throws Exception { ++ void separatorWrapComma() throws Exception { + final String[] expected = { + "31:17: " + getCheckMessage(SeparatorWrapCheck.class, "line.previous", ","), + }; +@@ -60,7 +60,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testSeparatorWrapMethodRef() throws Exception { ++ void separatorWrapMethodRef() throws Exception { + final String[] expected = { + "17:49: " + getCheckMessage(SeparatorWrapCheck.class, MSG_LINE_NEW, "::"), + }; +@@ -73,7 +73,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEllipsis() throws Exception { ++ void ellipsis() throws Exception { + final String[] expected = { + "11:13: " + getCheckMessage(SeparatorWrapCheck.class, "line.previous", "..."), + }; +@@ -86,7 +86,7 @@ public class SeparatorWrapTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testArrayDeclarator() throws Exception { ++ void arrayDeclarator() throws Exception { + final String[] expected = { + "9:13: " + getCheckMessage(SeparatorWrapCheck.class, "line.previous", "["), + }; +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java +index 5c3c20d04..a744df3c1 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule461verticalwhitespace/EmptyLineSeparatorTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck; + import org.junit.jupiter.api.Test; + +-public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { ++final class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class EmptyLineSeparatorTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparator() throws Exception { ++ void emptyLineSeparator() throws Exception { + final Class clazz = EmptyLineSeparatorCheck.class; + final String messageKey = "empty.line.separator"; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java +index 9b77c976c..80598180b 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/GenericWhitespaceTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { ++final class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundGenerics() throws Exception { ++ void whitespaceAroundGenerics() throws Exception { + final String msgPreceded = "ws.preceded"; + final String msgFollowed = "ws.followed"; + final Configuration checkConfig = getModuleConfig("GenericWhitespace"); +@@ -65,7 +65,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testGenericWhitespace() throws Exception { ++ void genericWhitespace() throws Exception { + final String msgPreceded = "ws.preceded"; + final String msgFollowed = "ws.followed"; + final String msgNotPreceded = "ws.notPreceded"; +@@ -109,7 +109,7 @@ public class GenericWhitespaceTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void genericEndsTheLine() throws Exception { ++ void genericEndsTheLine() throws Exception { + final Configuration checkConfig = getModuleConfig("GenericWhitespace"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputGenericWhitespaceEndsTheLine.java"), expected); +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/MethodParamPadTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/MethodParamPadTest.java +index 2dd47482c..2e6168257 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/MethodParamPadTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/MethodParamPadTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck; + import org.junit.jupiter.api.Test; + +-public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { ++final class MethodParamPadTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class MethodParamPadTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOperatorWrap() throws Exception { ++ void operatorWrap() throws Exception { + final Class clazz = MethodParamPadCheck.class; + final String messageKeyPreceded = "ws.preceded"; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeCaseDefaultColonTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeCaseDefaultColonTest.java +index 4730ecd0b..2e22c7414 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeCaseDefaultColonTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeCaseDefaultColonTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck; + import org.junit.jupiter.api.Test; + +-public class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModuleTestSupport { ++final class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class NoWhitespaceBeforeCaseDefaultColonTest extends AbstractGoogleModule + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + final Class clazz = NoWhitespaceBeforeCheck.class; + final String messageKeyPreceded = "ws.preceded"; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeTest.java +index 8de6f6d90..b314a2a29 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/NoWhitespaceBeforeTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { ++final class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEmptyForLoop() throws Exception { ++ void emptyForLoop() throws Exception { + final Class clazz = NoWhitespaceBeforeCheck.class; + final String messageKeyPreceded = "ws.preceded"; + +@@ -49,7 +49,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testColonOfLabel() throws Exception { ++ void colonOfLabel() throws Exception { + final Class clazz = NoWhitespaceBeforeCheck.class; + final String messageKeyPreceded = "ws.preceded"; + +@@ -64,7 +64,7 @@ public class NoWhitespaceBeforeTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testAnnotations() throws Exception { ++ void annotations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + final Configuration checkConfig = getModuleConfig("NoWhitespaceBefore"); + final String filePath = getPath("InputNoWhitespaceBeforeAnnotations.java"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/ParenPadTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/ParenPadTest.java +index 42c634850..96f045367 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/ParenPadTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/ParenPadTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck; + import org.junit.jupiter.api.Test; + +-public class ParenPadTest extends AbstractGoogleModuleTestSupport { ++final class ParenPadTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class ParenPadTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testMethodParen() throws Exception { ++ void methodParen() throws Exception { + final Class clazz = ParenPadCheck.class; + final String messageKeyPreceded = "ws.preceded"; + final String messageKeyFollowed = "ws.followed"; +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAfterTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAfterTest.java +index afcab048e..cf3527a04 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAfterTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAfterTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { ++final class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testWhitespaceAfterBad() throws Exception { ++ void whitespaceAfterBad() throws Exception { + final Class clazz = WhitespaceAfterCheck.class; + final String message = "ws.notFollowed"; + +@@ -70,7 +70,7 @@ public class WhitespaceAfterTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testWhitespaceAfterGood() throws Exception { ++ void whitespaceAfterGood() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + final Configuration checkConfig = getModuleConfig("WhitespaceAfter"); + final String filePath = getPath("InputWhitespaceAfterGood.java"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java +index 786734b50..15e6ea5a6 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule462horizontalwhitespace/WhitespaceAroundTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { ++final class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundBasic() throws Exception { ++ void whitespaceAroundBasic() throws Exception { + final Configuration checkConfig = getModuleConfig("WhitespaceAround"); + final String msgPreceded = "ws.notPreceded"; + final String msgFollowed = "ws.notFollowed"; +@@ -75,7 +75,7 @@ public class WhitespaceAroundTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundEmptyTypesCycles() throws Exception { ++ void whitespaceAroundEmptyTypesCycles() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("WhitespaceAround"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java +index 5a23b9ed7..3f95837d9 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4821onevariableperline/MultipleVariableDeclarationsTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck; + import org.junit.jupiter.api.Test; + +-public class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSupport { ++final class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class MultipleVariableDeclarationsTest extends AbstractGoogleModuleTestSu + } + + @Test +- public void testMultipleVariableDeclarations() throws Exception { ++ void multipleVariableDeclarations() throws Exception { + final String msgComma = + getCheckMessage( + MultipleVariableDeclarationsCheck.class, "multiple.variable.declarations.comma"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java +index 1e691855c..771327604 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4822variabledistance/VariableDeclarationUsageDistanceTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck; + import org.junit.jupiter.api.Test; + +-public class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTestSupport { ++final class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class VariableDeclarationUsageDistanceTest extends AbstractGoogleModuleTe + } + + @Test +- public void testArrayTypeStyle() throws Exception { ++ void arrayTypeStyle() throws Exception { + final String msgExt = "variable.declaration.usage.distance.extend"; + final Class clazz = + VariableDeclarationUsageDistanceCheck.class; +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java +index 8b502679a..8ba06c7ae 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4832nocstylearray/ArrayTypeStyleTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck; + import org.junit.jupiter.api.Test; + +-public class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { ++final class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class ArrayTypeStyleTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testArrayTypeStyle() throws Exception { ++ void arrayTypeStyle() throws Exception { + final String[] expected = { + "9:23: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), + "15:44: " + getCheckMessage(ArrayTypeStyleCheck.class, MSG_KEY), +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java +index 90f294e96..78344632c 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4841indentation/IndentationTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class IndentationTest extends AbstractIndentationTestSupport { ++final class IndentationTest extends AbstractIndentationTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectClass() throws Exception { ++ void correctClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -47,7 +47,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectField() throws Exception { ++ void correctField() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -58,7 +58,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectFor() throws Exception { ++ void correctFor() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -69,7 +69,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectIf() throws Exception { ++ void correctIf() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -80,7 +80,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectNewKeyword() throws Exception { ++ void correctNewKeyword() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -91,7 +91,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -102,7 +102,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectReturn() throws Exception { ++ void correctReturn() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -113,7 +113,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectWhile() throws Exception { ++ void correctWhile() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -124,7 +124,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectChained() throws Exception { ++ void correctChained() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +@@ -135,7 +135,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testWarnChained() throws Exception { ++ void warnChained() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(IndentationCheck.class, MSG_CHILD_ERROR, "method call", 4, 8), + "23:5: " + getCheckMessage(IndentationCheck.class, MSG_ERROR, ".", 4, 8), +@@ -151,7 +151,7 @@ public class IndentationTest extends AbstractIndentationTestSupport { + } + + @Test +- public void testCorrectAnnotationArrayInit() throws Exception { ++ void correctAnnotationArrayInit() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("Indentation"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java +index 67f3ac4cd..6bea8e75d 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4842fallthrough/FallThroughTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck; + import org.junit.jupiter.api.Test; + +-public class FallThroughTest extends AbstractGoogleModuleTestSupport { ++final class FallThroughTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class FallThroughTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testFallThrough() throws Exception { ++ void fallThrough() throws Exception { + final String msg = getCheckMessage(FallThroughCheck.class, "fall.through"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java +index b82f3e0b9..0e008b9d8 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4843defaultcasepresent/MissingSwitchDefaultTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck; + import org.junit.jupiter.api.Test; + +-public class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { ++final class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class MissingSwitchDefaultTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefault() throws Exception { ++ void missingSwitchDefault() throws Exception { + final String msg = getCheckMessage(MissingSwitchDefaultCheck.class, "missing.switch.default"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java +index c0a5bb33a..bd42e7d5b 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule485annotations/AnnotationLocationTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck; + import org.junit.jupiter.api.Test; + +-public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { ++final class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final Class clazz = AnnotationLocationCheck.class; + getCheckMessage(clazz, "annotation.location.alone"); + final Configuration checkConfig = +@@ -62,7 +62,7 @@ public class AnnotationLocationTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testAnnotationVariables() throws Exception { ++ void annotationVariables() throws Exception { + final Class clazz = AnnotationLocationCheck.class; + getCheckMessage(clazz, "annotation.location.alone"); + final Configuration checkConfig = +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java +index 42d40a897..bac82170c 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/CommentsIndentationTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck; + import org.junit.jupiter.api.Test; + +-public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { ++final class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCommentIsAtTheEndOfBlock() throws Exception { ++ void commentIsAtTheEndOfBlock() throws Exception { + final String[] expected = { + "18:26: " + + getCheckMessage( +@@ -125,7 +125,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCommentIsInsideSwitchBlock() throws Exception { ++ void commentIsInsideSwitchBlock() throws Exception { + final String[] expected = { + "19:13: " + + getCheckMessage( +@@ -228,7 +228,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCommentIsInsideEmptyBlock() throws Exception { ++ void commentIsInsideEmptyBlock() throws Exception { + final String[] expected = { + "9:20: " + + getCheckMessage( +@@ -255,7 +255,7 @@ public class CommentsIndentationTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testSurroundingCode() throws Exception { ++ void surroundingCode() throws Exception { + final String[] expected = { + "13:15: " + + getCheckMessage( +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java +index 19a6025be..c4e095419 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule487modifiers/ModifierOrderTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck; + import org.junit.jupiter.api.Test; + +-public class ModifierOrderTest extends AbstractGoogleModuleTestSupport { ++final class ModifierOrderTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class ModifierOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testModifierOrder() throws Exception { ++ void modifierOrder() throws Exception { + final Class clazz = ModifierOrderCheck.class; + final String msgMod = "mod.order"; + final String msgAnnotation = "annotation.order"; +diff --git a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java +index a88978f0e..3b3e47db1 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter4formatting/rule488numericliterals/UpperEllTest.java +@@ -23,7 +23,7 @@ import com.google.checkstyle.test.base.AbstractGoogleModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.Configuration; + import org.junit.jupiter.api.Test; + +-public class UpperEllTest extends AbstractGoogleModuleTestSupport { ++final class UpperEllTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class UpperEllTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testUpperEll() throws Exception { ++ void upperEll() throws Exception { + final String[] expected = { + "6:33: Should use uppercase 'L'.", + "12:25: Should use uppercase 'L'.", +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java +index 33f21d3d5..a0b3f46dd 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule51identifiernames/CatchParameterNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { ++final class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class CatchParameterNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCatchParameterName() throws Exception { ++ void catchParameterName() throws Exception { + final String msgKey = "name.invalidPattern"; + final Configuration checkConfig = getModuleConfig("CatchParameterName"); + final String format = checkConfig.getProperty("format"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java +index 6bcba71dc..26e17190b 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule521packagenames/PackageNameTest.java +@@ -26,7 +26,7 @@ import java.io.File; + import java.io.IOException; + import org.junit.jupiter.api.Test; + +-public class PackageNameTest extends AbstractGoogleModuleTestSupport { ++final class PackageNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -40,7 +40,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testGoodPackageName() throws Exception { ++ void goodPackageName() throws Exception { + final Configuration checkConfig = getModuleConfig("PackageName"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -51,7 +51,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testBadPackageName() throws Exception { ++ void badPackageName() throws Exception { + final String packagePath = + "com.google.checkstyle.test.chapter5naming.rule521packageNamesCamelCase"; + final Configuration checkConfig = getModuleConfig("PackageName"); +@@ -69,7 +69,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testBadPackageName2() throws Exception { ++ void badPackageName2() throws Exception { + final String packagePath = "com.google.checkstyle.test.chapter5naming.rule521_packagenames"; + final Configuration checkConfig = getModuleConfig("PackageName"); + final String format = checkConfig.getProperty("format"); +@@ -86,7 +86,7 @@ public class PackageNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testBadPackageName3() throws Exception { ++ void badPackageName3() throws Exception { + final String packagePath = "com.google.checkstyle.test.chapter5naming.rule521$packagenames"; + final Configuration checkConfig = getModuleConfig("PackageName"); + final String format = checkConfig.getProperty("format"); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java +index cae1f1930..c83a398f3 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule522typenames/TypeNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class TypeNameTest extends AbstractGoogleModuleTestSupport { ++final class TypeNameTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class TypeNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testTypeName() throws Exception { ++ void typeName() throws Exception { + final Configuration checkConfig = getModuleConfig("TypeName"); + final String msgKey = "name.invalidPattern"; + final String format = "^[A-Z][a-zA-Z0-9]*$"; +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java +index 42984be97..70ad0130a 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule523methodnames/MethodNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class MethodNameTest extends AbstractGoogleModuleTestSupport { ++final class MethodNameTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class MethodNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testMethodName() throws Exception { ++ void methodName() throws Exception { + final Configuration checkConfig = getModuleConfig("MethodName"); + final String msgKey = "name.invalidPattern"; + final String format = "^[a-z][a-z0-9]\\w*$"; +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java +index d788e3cda..0f15ed97a 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule525nonconstantfieldnames/MemberNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class MemberNameTest extends AbstractGoogleModuleTestSupport { ++final class MemberNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class MemberNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testMemberName() throws Exception { ++ void memberName() throws Exception { + final Configuration checkConfig = getModuleConfig("MemberName"); + final String format = checkConfig.getProperty("format"); + final Map messages = checkConfig.getMessages(); +@@ -61,7 +61,7 @@ public class MemberNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final Configuration checkConfig = getModuleConfig("MemberName"); + final String format = checkConfig.getProperty("format"); + final Map messages = checkConfig.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/LambdaParameterNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/LambdaParameterNameTest.java +index 431894ede..c973969ee 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/LambdaParameterNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/LambdaParameterNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { ++final class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { + + public static final String MSG_INVALID_PATTERN = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class LambdaParameterNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testLambdaParameterName() throws Exception { ++ void lambdaParameterName() throws Exception { + final Configuration config = getModuleConfig("LambdaParameterName"); + final String format = config.getProperty("format"); + final Map messages = config.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java +index 7e45722ed..01c4db8f2 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/ParameterNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class ParameterNameTest extends AbstractGoogleModuleTestSupport { ++final class ParameterNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class ParameterNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testGeneralParameterName() throws Exception { ++ void generalParameterName() throws Exception { + final Configuration config = getModuleConfig("ParameterName"); + final String format = config.getProperty("format"); + final Map messages = config.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/RecordComponentNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/RecordComponentNameTest.java +index cda189ac8..704dae5d8 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/RecordComponentNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule526parameternames/RecordComponentNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class RecordComponentNameTest extends AbstractGoogleModuleTestSupport { ++final class RecordComponentNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class RecordComponentNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testGeneralParameterName() throws Exception { ++ void generalParameterName() throws Exception { + final Configuration config = getModuleConfig("RecordComponentName"); + final String format = config.getProperty("format"); + final Map messages = config.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java +index d0989a793..df9d323e2 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/LocalVariableNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { ++final class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testLocalVariableName() throws Exception { ++ void localVariableName() throws Exception { + final Configuration checkConfig = getModuleConfig("LocalVariableName"); + final String format = checkConfig.getProperty("format"); + final Map messages = checkConfig.getMessages(); +@@ -58,7 +58,7 @@ public class LocalVariableNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testOneChar() throws Exception { ++ void oneChar() throws Exception { + final Configuration checkConfig = getModuleConfig("LocalVariableName"); + final String format = checkConfig.getProperty("format"); + final Map messages = checkConfig.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/PatternVariableNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/PatternVariableNameTest.java +index 57caf1062..5713c66e7 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/PatternVariableNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule527localvariablenames/PatternVariableNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { ++final class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class PatternVariableNameTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testPatternVariableName() throws Exception { ++ void patternVariableName() throws Exception { + final Configuration checkConfig = getModuleConfig("PatternVariableName"); + final String format = checkConfig.getProperty("format"); + final Map messages = checkConfig.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java +index db9826d2c..a8fe073a7 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/ClassTypeParameterNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class ClassTypeParameterNameTest extends AbstractGoogleModuleTestSupport { ++final class ClassTypeParameterNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class ClassTypeParameterNameTest extends AbstractGoogleModuleTestSupport + } + + @Test +- public void testClassDefault() throws Exception { ++ void classDefault() throws Exception { + final Configuration configuration = getModuleConfig("ClassTypeParameterName"); + final String format = configuration.getProperty("format"); + final Map messages = configuration.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java +index b94cc1a04..e8efef2b8 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/InterfaceTypeParameterNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class InterfaceTypeParameterNameTest extends AbstractGoogleModuleTestSupport { ++final class InterfaceTypeParameterNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class InterfaceTypeParameterNameTest extends AbstractGoogleModuleTestSupp + } + + @Test +- public void testInterfaceDefault() throws Exception { ++ void interfaceDefault() throws Exception { + final Configuration configuration = getModuleConfig("InterfaceTypeParameterName"); + final String format = configuration.getProperty("format"); + final Map messages = configuration.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java +index dc298cfb5..d4ce1dcd2 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/MethodTypeParameterNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class MethodTypeParameterNameTest extends AbstractGoogleModuleTestSupport { ++final class MethodTypeParameterNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class MethodTypeParameterNameTest extends AbstractGoogleModuleTestSupport + } + + @Test +- public void testMethodDefault() throws Exception { ++ void methodDefault() throws Exception { + final Configuration checkConfig = getModuleConfig("MethodTypeParameterName"); + final String format = checkConfig.getProperty("format"); + final Map messages = checkConfig.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/RecordTypeParameterNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/RecordTypeParameterNameTest.java +index acb24a722..ac6e4d32f 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/RecordTypeParameterNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule528typevariablenames/RecordTypeParameterNameTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class RecordTypeParameterNameTest extends AbstractGoogleModuleTestSupport { ++final class RecordTypeParameterNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "name.invalidPattern"; + +@@ -34,7 +34,7 @@ public class RecordTypeParameterNameTest extends AbstractGoogleModuleTestSupport + } + + @Test +- public void testRecordDefault() throws Exception { ++ void recordDefault() throws Exception { + final Configuration configuration = getModuleConfig("RecordTypeParameterName"); + final String format = configuration.getProperty("format"); + final Map messages = configuration.getMessages(); +diff --git a/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java b/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java +index 1c27135b0..8596bf7c5 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter5naming/rule53camelcase/AbbreviationAsWordInNameTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameChe + import java.io.IOException; + import org.junit.jupiter.api.Test; + +-public class AbbreviationAsWordInNameTest extends AbstractGoogleModuleTestSupport { ++final class AbbreviationAsWordInNameTest extends AbstractGoogleModuleTestSupport { + + private static final String MSG_KEY = "abbreviation.as.word"; + private final Class clazz = AbbreviationAsWordInNameCheck.class; +@@ -36,7 +36,7 @@ public class AbbreviationAsWordInNameTest extends AbstractGoogleModuleTestSuppor + } + + @Test +- public void testAbbreviationAsWordInName() throws Exception { ++ void abbreviationAsWordInName() throws Exception { + final int maxCapitalCount = 1; + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java +index 81322c28c..227aabc42 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule62donotignoreexceptions/EmptyBlockTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck; + import org.junit.jupiter.api.Test; + +-public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { ++final class EmptyBlockTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class EmptyBlockTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testEmptyBlockCatch() throws Exception { ++ void emptyBlockCatch() throws Exception { + final String[] expected = { + "29:17: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), + "50:21: " + getCheckMessage(EmptyBlockCheck.class, "block.empty", "finally"), +diff --git a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java +index de9cfd054..576abe929 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter6programpractice/rule64finalizers/NoFinalizerTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck; + import org.junit.jupiter.api.Test; + +-public class NoFinalizerTest extends AbstractGoogleModuleTestSupport { ++final class NoFinalizerTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class NoFinalizerTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testNoFinalizerBasic() throws Exception { ++ void noFinalizerBasic() throws Exception { + final String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method"); + + final String[] expected = { +@@ -47,7 +47,7 @@ public class NoFinalizerTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testNoFinalizerExtended() throws Exception { ++ void noFinalizerExtended() throws Exception { + final String msg = getCheckMessage(NoFinalizerCheck.class, "avoid.finalizer.method"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InvalidJavadocPositionTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InvalidJavadocPositionTest.java +index 7723b6b07..9608e3a6b 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InvalidJavadocPositionTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/InvalidJavadocPositionTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionCheck; + import org.junit.jupiter.api.Test; + +-public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { ++final class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String message = getCheckMessage(InvalidJavadocPositionCheck.class, "invalid.position"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java +index 93c743fd8..7e3a7d9dd 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule711generalform/SingleLineJavadocTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.SingleLineJavadocCheck; + import org.junit.jupiter.api.Test; + +-public class SingleLineJavadocTest extends AbstractGoogleModuleTestSupport { ++final class SingleLineJavadocTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class SingleLineJavadocTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testSingleLineJavadoc() throws Exception { ++ void singleLineJavadoc() throws Exception { + final String msg = getCheckMessage(SingleLineJavadocCheck.class, "singleline.javadoc"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java +index e173f6597..600349ada 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/JavadocParagraphTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { ++final class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testJavadocParagraphCorrect() throws Exception { ++ void javadocParagraphCorrect() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("JavadocParagraph"); +@@ -44,7 +44,7 @@ public class JavadocParagraphTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testJavadocParagraphIncorrect() throws Exception { ++ void javadocParagraphIncorrect() throws Exception { + final String msgBefore = + getCheckMessage(JavadocParagraphCheck.class, "javadoc.paragraph.line.before"); + final String msgRed = +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/RequireEmptyLineBeforeBlockTagGroupTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/RequireEmptyLineBeforeBlockTagGroupTest.java +index 01db41fd2..e554b311d 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/RequireEmptyLineBeforeBlockTagGroupTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule712paragraphs/RequireEmptyLineBeforeBlockTagGroupTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.IOException; + import org.junit.jupiter.api.Test; + +-public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModuleTestSupport { ++final class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModul + } + + @Test +- public void testJavadocParagraphCorrect() throws Exception { ++ void javadocParagraphCorrect() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("RequireEmptyLineBeforeBlockTagGroup"); +@@ -45,7 +45,7 @@ public class RequireEmptyLineBeforeBlockTagGroupTest extends AbstractGoogleModul + } + + @Test +- public void testJavadocParagraphIncorrect() throws Exception { ++ void javadocParagraphIncorrect() throws Exception { + final String[] expected = { + "5: " + getTagCheckMessage("@since"), + "11: " + getTagCheckMessage("@param"), +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java +index bc5630a5d..e54f8f6ce 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/AtclauseOrderTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { ++final class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("AtclauseOrder"); +@@ -44,7 +44,7 @@ public class AtclauseOrderTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String tagOrder = "[@param, @return, @throws, @deprecated]"; + final String msg = getCheckMessage(AtclauseOrderCheck.class, "at.clause.order", tagOrder); + +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java +index b95959351..0d001cd81 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/JavadocTagContinuationIndentationTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagContinuationIndentationCheck; + import org.junit.jupiter.api.Test; + +-public class JavadocTagContinuationIndentationTest extends AbstractGoogleModuleTestSupport { ++final class JavadocTagContinuationIndentationTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class JavadocTagContinuationIndentationTest extends AbstractGoogleModuleT + } + + @Test +- public void testWithDefaultConfiguration() throws Exception { ++ void withDefaultConfiguration() throws Exception { + final String msg = + getCheckMessage(JavadocTagContinuationIndentationCheck.class, "tag.continuation.indent", 4); + +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java +index 082664231..a786bd8c9 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule713atclauses/NonEmptyAtclauseDescriptionTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck; + import org.junit.jupiter.api.Test; + +-public class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSupport { ++final class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSup + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String msg = + getCheckMessage(NonEmptyAtclauseDescriptionCheck.class, "non.empty.atclause"); + +@@ -58,7 +58,7 @@ public class NonEmptyAtclauseDescriptionTest extends AbstractGoogleModuleTestSup + } + + @Test +- public void testSpaceSequence() throws Exception { ++ void spaceSequence() throws Exception { + final String msg = + getCheckMessage(NonEmptyAtclauseDescriptionCheck.class, "non.empty.atclause"); + +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java +index 2ef36440a..266269926 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule72thesummaryfragment/SummaryJavadocTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { ++final class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + final Configuration checkConfig = getModuleConfig("SummaryJavadoc"); +@@ -44,7 +44,7 @@ public class SummaryJavadocTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String msgFirstSentence = + getCheckMessage(SummaryJavadocCheck.class, "summary.first.sentence"); + final String msgForbiddenFragment = +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java +index 0c2e36f92..2cb74290e 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/JavadocMethodTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocMethodTest extends AbstractGoogleModuleTestSupport { ++final class JavadocMethodTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class JavadocMethodTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testJavadocMethod() throws Exception { ++ void javadocMethod() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/MissingJavadocMethodTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/MissingJavadocMethodTest.java +index 0172b9d0a..abc4ed51e 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/MissingJavadocMethodTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule731selfexplanatory/MissingJavadocMethodTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck; + import org.junit.jupiter.api.Test; + +-public class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { ++final class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class MissingJavadocMethodTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testJavadocMethod() throws Exception { ++ void javadocMethod() throws Exception { + final String msg = getCheckMessage(MissingJavadocMethodCheck.class, "javadoc.missing"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/InvalidJavadocPositionTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/InvalidJavadocPositionTest.java +index 7c3f2e124..06c4b417d 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/InvalidJavadocPositionTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule734nonrequiredjavadoc/InvalidJavadocPositionTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionCheck; + import org.junit.jupiter.api.Test; + +-public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { ++final class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest extends AbstractGoogleModuleTestSupport + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String message = getCheckMessage(InvalidJavadocPositionCheck.class, "invalid.position"); + + final String[] expected = { +diff --git a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/MissingJavadocTypeTest.java b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/MissingJavadocTypeTest.java +index 109d32d20..c9dd6c4c6 100644 +--- a/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/MissingJavadocTypeTest.java ++++ b/src/it/java/com/google/checkstyle/test/chapter7javadoc/rule73wherejavadocrequired/MissingJavadocTypeTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocTypeCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { ++final class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testJavadocType() throws Exception { ++ void javadocType() throws Exception { + + final String[] expected = { + "3:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), +@@ -58,7 +58,7 @@ public class MissingJavadocTypeTest extends AbstractGoogleModuleTestSupport { + } + + @Test +- public void testJavadocTypeNoViolations() throws Exception { ++ void javadocTypeNoViolations() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/it/java/com/sun/checkstyle/test/chapter5comments/rule52documentationcomments/InvalidJavadocPositionTest.java b/src/it/java/com/sun/checkstyle/test/chapter5comments/rule52documentationcomments/InvalidJavadocPositionTest.java +index 36638bdfc..7507e4abe 100644 +--- a/src/it/java/com/sun/checkstyle/test/chapter5comments/rule52documentationcomments/InvalidJavadocPositionTest.java ++++ b/src/it/java/com/sun/checkstyle/test/chapter5comments/rule52documentationcomments/InvalidJavadocPositionTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionChec + import com.sun.checkstyle.test.base.AbstractSunModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class InvalidJavadocPositionTest extends AbstractSunModuleTestSupport { ++final class InvalidJavadocPositionTest extends AbstractSunModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class InvalidJavadocPositionTest extends AbstractSunModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String message = getCheckMessage(InvalidJavadocPositionCheck.class, "invalid.position"); + + final String[] expected = { +diff --git a/src/it/java/com/sun/checkstyle/test/chapter6declarations/rule61numberperline/MultipleVariableDeclarationsTest.java b/src/it/java/com/sun/checkstyle/test/chapter6declarations/rule61numberperline/MultipleVariableDeclarationsTest.java +index 6fa7066ff..617bfd77e 100644 +--- a/src/it/java/com/sun/checkstyle/test/chapter6declarations/rule61numberperline/MultipleVariableDeclarationsTest.java ++++ b/src/it/java/com/sun/checkstyle/test/chapter6declarations/rule61numberperline/MultipleVariableDeclarationsTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclaration + import com.sun.checkstyle.test.base.AbstractSunModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class MultipleVariableDeclarationsTest extends AbstractSunModuleTestSupport { ++final class MultipleVariableDeclarationsTest extends AbstractSunModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class MultipleVariableDeclarationsTest extends AbstractSunModuleTestSuppo + } + + @Test +- public void testMultipleVariableDeclarations() throws Exception { ++ void multipleVariableDeclarations() throws Exception { + final String msgComma = + getCheckMessage( + MultipleVariableDeclarationsCheck.class, "multiple.variable.declarations.comma"); +diff --git a/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java b/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java +index 5d862734a..ad647c5b9 100644 +--- a/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java ++++ b/src/it/java/org/checkstyle/base/AbstractItModuleTestSupport.java +@@ -20,6 +20,7 @@ + package org.checkstyle.base; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractPathTestSupport; + import com.puppycrawl.tools.checkstyle.Checker; +@@ -397,8 +398,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor + + // process each of the lines + try (ByteArrayInputStream inputStream = new ByteArrayInputStream(stream.toByteArray()); +- LineNumberReader lnr = +- new LineNumberReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { ++ LineNumberReader lnr = new LineNumberReader(new InputStreamReader(inputStream, UTF_8))) { + int previousLineNumber = 0; + for (int index = 0; index < expected.length; index++) { + final String expectedResult = messageFileName + ":" + expected[index]; +@@ -493,7 +493,7 @@ public abstract class AbstractItModuleTestSupport extends AbstractPathTestSuppor + */ + protected Integer[] getLinesWithWarn(String fileName) throws IOException { + final List result = new ArrayList<>(); +- try (BufferedReader br = Files.newBufferedReader(Paths.get(fileName), StandardCharsets.UTF_8)) { ++ try (BufferedReader br = Files.newBufferedReader(Paths.get(fileName), UTF_8)) { + int lineNumber = 1; + while (true) { + final String line = br.readLine(); +diff --git a/src/it/java/org/checkstyle/checks/imports/ImportOrderTest.java b/src/it/java/org/checkstyle/checks/imports/ImportOrderTest.java +index 7ace8320a..3dde46575 100644 +--- a/src/it/java/org/checkstyle/checks/imports/ImportOrderTest.java ++++ b/src/it/java/org/checkstyle/checks/imports/ImportOrderTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.checkstyle.base.AbstractCheckstyleModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { ++final class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { + } + + @Test +- public void testAndroid() throws Exception { ++ void android() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); + checkConfig.addProperty( + "groups", "android,androidx,com.android,dalvik,com,gov,junit,libcore,net,org,java,javax"); +@@ -52,7 +52,7 @@ public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { + } + + @Test +- public void testSpotify() throws Exception { ++ void spotify() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); + checkConfig.addProperty("groups", "android,com,net,junit,org,java,javax"); + checkConfig.addProperty("option", "bottom"); +@@ -68,7 +68,7 @@ public class ImportOrderTest extends AbstractCheckstyleModuleTestSupport { + } + + @Test +- public void testTwitter() throws Exception { ++ void twitter() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); + checkConfig.addProperty("caseSensitive", "true"); + checkConfig.addProperty("groups", "android,com.twitter,com,junit,net,org,java,javax"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java b/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java +index 335316c0b..73aee4e41 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/AbstractXpathTestSupport.java +@@ -20,6 +20,7 @@ + package org.checkstyle.suppressionxpathfilter; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.JavaParser; +@@ -114,7 +115,7 @@ public abstract class AbstractXpathTestSupport extends AbstractCheckstyleModuleT + private String createSuppressionsXpathConfigFile(String checkName, List xpathQueries) + throws Exception { + final Path suppressionsXpathConfigPath = Files.createTempFile(temporaryFolder, "", ""); +- try (Writer bw = Files.newBufferedWriter(suppressionsXpathConfigPath, StandardCharsets.UTF_8)) { ++ try (Writer bw = Files.newBufferedWriter(suppressionsXpathConfigPath, UTF_8)) { + bw.write("\n"); + bw.write(" expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameAnnotation']]" + + "/OBJBLOCK/ANNOTATION_DEF/IDENT[@text='ANNOTATION']"); +@@ -62,7 +62,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testAnnotationField() throws Exception { ++ void annotationField() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameAnnotationField.java")); + +@@ -79,7 +79,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/ANNOTATION_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameAnnotationField']]" + + "/OBJBLOCK/ANNOTATION_FIELD_DEF/IDENT[@text='ANNOTATION_FIELD']"); +@@ -88,7 +88,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testClass() throws Exception { ++ void testClass() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameClass.java")); + +@@ -105,7 +105,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameClass']]" + + "/OBJBLOCK/CLASS_DEF/IDENT[@text='CLASS']"); +@@ -114,7 +114,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testEnum() throws Exception { ++ void testEnum() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameEnum.java")); + +@@ -131,7 +131,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameEnum']]" + + "/OBJBLOCK/ENUM_DEF/IDENT[@text='ENUMERATION']"); +@@ -140,7 +140,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testField() throws Exception { ++ void field() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameField.java")); + +@@ -157,7 +157,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameField']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='FIELD']"); +@@ -166,7 +166,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameInterface.java")); + +@@ -183,7 +183,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameInterface']]" + + "/OBJBLOCK/INTERFACE_DEF/IDENT[@text='INTERFACE']"); +@@ -192,7 +192,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameMethod.java")); + +@@ -209,7 +209,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/INTERFACE_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameMethod']]" + + "/OBJBLOCK/METHOD_DEF/IDENT[@text='METHOD']"); +@@ -218,7 +218,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testParameter() throws Exception { ++ void parameter() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameParameter.java")); + +@@ -235,7 +235,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/INTERFACE_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameParameter']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" +@@ -245,7 +245,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + } + + @Test +- public void testVariable() throws Exception { ++ void variable() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbbreviationAsWordInNameVariable.java")); + +@@ -262,7 +262,7 @@ public class XpathRegressionAbbreviationAsWordInNameTest extends AbstractXpathTe + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionAbbreviationAsWordInNameVariable']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbstractClassNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbstractClassNameTest.java +index a34436ed6..18a28e44a 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbstractClassNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAbstractClassNameTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSupport { + + private final String checkName = AbstractClassNameCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testClassNameTop() throws Exception { ++ void classNameTop() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbstractClassNameTop.java")); + +@@ -66,7 +66,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testClassNameInner() throws Exception { ++ void classNameInner() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbstractClassNameInner.java")); + +@@ -97,7 +97,7 @@ public class XpathRegressionAbstractClassNameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testClassNameNoModifier() throws Exception { ++ void classNameNoModifier() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAbstractClassNameNoModifier.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java +index 10f948838..0c6f90165 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationLocationTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupport { ++final class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupport { + + private final String checkName = AnnotationLocationCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + } + + @Test +- public void testClass() throws Exception { ++ void testClass() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationLocationClass.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + } + + @Test +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationLocationInterface.java")); + +@@ -101,7 +101,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + } + + @Test +- public void testEnum() throws Exception { ++ void testEnum() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationLocationEnum.java")); + +@@ -133,7 +133,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + } + + @Test +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationLocationMethod.java")); + +@@ -169,7 +169,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + } + + @Test +- public void testVariable() throws Exception { ++ void variable() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationLocationVariable.java")); + +@@ -205,7 +205,7 @@ public class XpathRegressionAnnotationLocationTest extends AbstractXpathTestSupp + } + + @Test +- public void testConstructor() throws Exception { ++ void constructor() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationLocationCTOR.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationOnSameLineTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationOnSameLineTest.java +index 1447727cc..7162f5af3 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationOnSameLineTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationOnSameLineTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSupport { ++final class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSupport { + + private final String checkName = AnnotationOnSameLineCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineOne.java")); + +@@ -78,7 +78,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineTwo.java")); + +@@ -113,7 +113,7 @@ public class XpathRegressionAnnotationOnSameLineTest extends AbstractXpathTestSu + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationOnSameLineThree.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.java +index 3ff98dc61..cc6842bd2 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnnotationUseStyleTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupport { ++final class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupport { + + private final String checkName = AnnotationUseStyleCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleOne.java")); + +@@ -64,7 +64,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleTwo.java")); + +@@ -99,7 +99,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleThree.java")); + +@@ -136,7 +136,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleFour.java")); + +@@ -154,7 +154,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionAnnotationUseStyleFour']]" + + "/MODIFIERS/ANNOTATION[./IDENT[@text='SuppressWarnings']]" +@@ -164,7 +164,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleFive.java")); + +@@ -200,7 +200,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testSix() throws Exception { ++ void six() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleSix.java")); + +@@ -236,7 +236,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testSeven() throws Exception { ++ void seven() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleSeven.java")); + +@@ -263,7 +263,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + } + + @Test +- public void testEight() throws Exception { ++ void eight() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnnotationUseStyleEight.java")); + +@@ -281,7 +281,7 @@ public class XpathRegressionAnnotationUseStyleTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionAnnotationUseStyleEight']]" + + "/MODIFIERS/ANNOTATION[./IDENT[@text='SuppressWarnings']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnonInnerLengthTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnonInnerLengthTest.java +index e2c294e4f..23a51b3a4 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnonInnerLengthTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAnonInnerLengthTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport { ++final class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport { + + private final String checkName = AnonInnerLengthCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAnonInnerLengthDefault.java")); + +@@ -63,7 +63,7 @@ public class XpathRegressionAnonInnerLengthTest extends AbstractXpathTestSupport + } + + @Test +- public void testMaxLength() throws Exception { ++ void maxLength() throws Exception { + final int maxLen = 5; + final File fileToProcess = new File(getPath("SuppressionXpathRegressionAnonInnerLength.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.java +index 638e1fcd8..652f45893 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTrailingCommaTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupport { ++final class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupport { + + private final String checkName = ArrayTrailingCommaCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionArrayTrailingCommaOne.java")); + +@@ -62,7 +62,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionArrayTrailingCommaTwo.java")); + +@@ -73,7 +73,7 @@ public class XpathRegressionArrayTrailingCommaTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionArrayTrailingCommaTwo']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='d2']]/ASSIGN/EXPR/LITERAL_NEW" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java +index ce1cbcc25..1d9639c55 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionArrayTypeStyleTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport { ++final class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport + } + + @Test +- public void testVariable() throws Exception { ++ void variable() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionArrayTypeStyleVariable.java")); + +@@ -45,7 +45,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionArrayTypeStyleVariable']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='strings']]/TYPE[" +@@ -55,7 +55,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport + } + + @Test +- public void testMethodDef() throws Exception { ++ void methodDef() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionArrayTypeStyleMethodDef.java")); + +@@ -66,7 +66,7 @@ public class XpathRegressionArrayTypeStyleTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionArrayTypeStyleMethodDef']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='getData']]/TYPE/ARRAY_DECLARATOR"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidDoubleBraceInitializationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidDoubleBraceInitializationTest.java +index d61b59e10..101b9310b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidDoubleBraceInitializationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidDoubleBraceInitializationTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractXpathTestSupport { ++final class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractXpathTestSupport { + + private final Class clazz = + AvoidDoubleBraceInitializationCheck.class; +@@ -37,7 +37,7 @@ public class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractX + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidDoubleBraceInitialization.java")); + +@@ -62,7 +62,7 @@ public class XpathRegressionAvoidDoubleBraceInitializationTest extends AbstractX + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidDoubleBraceInitializationTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java +index 66c828ec6..c0878e410 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidEscapedUnicodeCharactersTest.java +@@ -28,7 +28,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXpathTestSupport { ++final class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXpathTestSupport { + private final String checkName = AvoidEscapedUnicodeCharactersCheck.class.getSimpleName(); + + @Override +@@ -37,7 +37,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersDefault.java")); + +@@ -63,7 +63,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp + } + + @Test +- public void testControlCharacters() throws Exception { ++ void controlCharacters() throws Exception { + final File fileToProcess = + new File( + getPath( +@@ -94,7 +94,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp + } + + @Test +- public void testTailComment() throws Exception { ++ void tailComment() throws Exception { + final File fileToProcess = + new File( + getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersTailComment.java")); +@@ -124,7 +124,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp + } + + @Test +- public void testAllCharactersEscaped() throws Exception { ++ void allCharactersEscaped() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersAllEscaped.java")); + +@@ -153,7 +153,7 @@ public class XpathRegressionAvoidEscapedUnicodeCharactersTest extends AbstractXp + } + + @Test +- public void testNonPrintableCharacters() throws Exception { ++ void nonPrintableCharacters() throws Exception { + final File fileToProcess = + new File( + getPath("SuppressionXpathRegressionAvoidEscapedUnicodeCharactersNonPrintable.java")); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.java +index 2457d0f3d..9d3a4738f 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidInlineConditionalsTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTestSupport { ++final class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -35,7 +35,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes + } + + @Test +- public void testInlineConditionalsVariableDef() throws Exception { ++ void inlineConditionalsVariableDef() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsVariableDef.java")); + +@@ -63,7 +63,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes + } + + @Test +- public void testInlineConditionalsAssign() throws Exception { ++ void inlineConditionalsAssign() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsAssign.java")); + +@@ -77,7 +77,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='" + + "SuppressionXpathRegressionAvoidInlineConditionalsAssign']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='setB']]/SLIST" +@@ -87,7 +87,7 @@ public class XpathRegressionAvoidInlineConditionalsTest extends AbstractXpathTes + } + + @Test +- public void testInlineConditionalsAssert() throws Exception { ++ void inlineConditionalsAssert() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidInlineConditionalsAssert.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.java +index 37c9d1cfc..2f3c585f5 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNestedBlocksTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSupport { ++final class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -35,7 +35,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + } + + @Test +- public void testEmpty() throws Exception { ++ void empty() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksEmpty.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionAvoidNestedBlocksEmpty']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='empty']]/SLIST/SLIST"); +@@ -57,7 +57,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + } + + @Test +- public void testVariableAssignment() throws Exception { ++ void variableAssignment() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksVariable.java")); + +@@ -70,7 +70,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionAvoidNestedBlocksVariable']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='varAssign']]/SLIST/SLIST"); +@@ -79,7 +79,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + } + + @Test +- public void testSwitchAllowInSwitchCaseFalse() throws Exception { ++ void switchAllowInSwitchCaseFalse() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksSwitch1.java")); + +@@ -112,7 +112,7 @@ public class XpathRegressionAvoidNestedBlocksTest extends AbstractXpathTestSuppo + } + + @Test +- public void testSwitchAllowInSwitchCaseTrue() throws Exception { ++ void switchAllowInSwitchCaseTrue() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidNestedBlocksSwitch2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java +index d835a03db..ba7dcc08f 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidNoArgumentSuperConstructorCallTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.AvoidNoArgumentSuperConstructorCallCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest ++final class XpathRegressionAvoidNoArgumentSuperConstructorCallTest + extends AbstractXpathTestSupport { + + private static final Class CLASS = +@@ -38,7 +38,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall.java")); + +@@ -49,7 +49,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCall']]" + + "/OBJBLOCK/CTOR_DEF[./IDENT[" +@@ -60,7 +60,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final File fileToProcess = + new File( + getPath( +@@ -73,7 +73,7 @@ public class XpathRegressionAvoidNoArgumentSuperConstructorCallTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionAvoidNoArgumentSuperConstructorCallInnerClass']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java +index 06f0653f7..3e3cb7d8b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStarImportTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport { ++final class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport { + + private static final Class CLASS = AvoidStarImportCheck.class; + +@@ -36,7 +36,7 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStarImport1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -47,13 +47,13 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); ++ ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionAvoidStarImport2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -62,8 +62,7 @@ public class XpathRegressionAvoidStarImportTest extends AbstractXpathTestSupport + "4:15: " + getCheckMessage(CLASS, AvoidStarImportCheck.MSG_KEY, "java.io.*"), + }; + +- final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT/DOT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT/DOT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStaticImportTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStaticImportTest.java +index 2eb30831d..adecb674f 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStaticImportTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionAvoidStaticImportTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSupport { ++final class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSupport { + + private static final Class CLASS = AvoidStaticImportCheck.class; + +@@ -36,7 +36,7 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidStaticImport1.java")); + +@@ -48,13 +48,13 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); ++ ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT/DOT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionAvoidStaticImport2.java")); + +@@ -66,8 +66,7 @@ public class XpathRegressionAvoidStaticImportTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( +- "/COMPILATION_UNIT/STATIC_IMPORT/DOT[./IDENT[@text='createTempFile']]"); ++ ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT/DOT[./IDENT[@text='createTempFile']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java +index 68f050968..3bf548249 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionClassMemberImpliedModifierTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpathTestSupport { ++final class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpathTestSupport { + + private final String checkName = ClassMemberImpliedModifierCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpath + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionClassMemberImpliedModifierOne.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionClassMemberImpliedModifierTest extends AbstractXpath + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionClassMemberImpliedModifierTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java +index 0a5e30e94..56f9ca9b1 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCommentsIndentationTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSupport { ++final class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSupport { + + private final String checkName = CommentsIndentationCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testSingleLine() throws Exception { ++ void singleLine() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "SingleLine.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationSingleLine']]" + + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' Comment // warn\\n']]"); +@@ -57,7 +57,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testBlock() throws Exception { ++ void block() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "Block.java")); + +@@ -69,7 +69,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationBlock']]/OBJBLOCK/" + + "VARIABLE_DEF[./IDENT[@text='f']]/TYPE/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" +@@ -79,7 +79,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testSeparator() throws Exception { ++ void separator() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "Separator.java")); + +@@ -92,7 +92,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationSeparator']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/MODIFIERS/SINGLE_LINE_COMMENT" +@@ -102,7 +102,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testDistributedStatement() throws Exception { ++ void distributedStatement() throws Exception { + final File fileToProcess = + new File( + getPath("SuppressionXpathRegressionCommentsIndentation" + "DistributedStatement.java")); +@@ -116,7 +116,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationDistributedStatement']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" +@@ -126,7 +126,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testSingleLineBlock() throws Exception { ++ void singleLineBlock() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "SingleLineBlock.java")); + +@@ -138,7 +138,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationSingleLineBlock']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/SINGLE_LINE_COMMENT" +@@ -148,7 +148,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testNonEmptyCase() throws Exception { ++ void nonEmptyCase() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "NonEmptyCase.java")); + +@@ -161,7 +161,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationNonEmptyCase']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" +@@ -171,7 +171,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testEmptyCase() throws Exception { ++ void emptyCase() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCommentsIndentation" + "EmptyCase.java")); + +@@ -184,7 +184,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationEmptyCase']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/LITERAL_SWITCH/" +@@ -194,7 +194,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + } + + @Test +- public void testWithinBlockStatement() throws Exception { ++ void withinBlockStatement() throws Exception { + final File fileToProcess = + new File( + getPath("SuppressionXpathRegressionCommentsIndentation" + "WithinBlockStatement.java")); +@@ -208,7 +208,7 @@ public class XpathRegressionCommentsIndentationTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionCommentsIndentationWithinBlockStatement']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/SLIST/VARIABLE_DEF" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java +index f10acde96..cba83bf0c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionConstantNameTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + + private static final Class CLASS = ConstantNameCheck.class; + private static final String PATTERN = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; +@@ -40,7 +40,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void testLowercase() throws Exception { ++ void lowercase() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionConstantNameLowercase.java")); + +@@ -51,7 +51,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionConstantNameLowercase']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='number']"); +@@ -60,7 +60,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void testCamelCase() throws Exception { ++ void camelCase() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionConstantNameCamelCase.java")); + +@@ -71,7 +71,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionConstantNameCamelCase']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='badConstant']"); +@@ -80,7 +80,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void testWithBeginningUnderscore() throws Exception { ++ void withBeginningUnderscore() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionConstantNameWithBeginningUnderscore.java")); + +@@ -91,7 +91,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionConstantNameWithBeginningUnderscore']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='_CONSTANT']"); +@@ -100,7 +100,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void testWithTwoUnderscores() throws Exception { ++ void withTwoUnderscores() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionConstantNameWithTwoUnderscores.java")); + +@@ -111,7 +111,7 @@ public class XpathRegressionConstantNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionConstantNameWithTwoUnderscores']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='BAD__NAME']"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java +index 4da87f6a9..cfb44c66c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCovariantEqualsTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport { ++final class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport { + + private final String checkName = CovariantEqualsCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + } + + @Test +- public void testCovariantEqualsInClass() throws Exception { ++ void covariantEqualsInClass() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCovariantEqualsInClass.java")); + +@@ -47,7 +47,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInClass']]" + + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); +@@ -56,7 +56,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + } + + @Test +- public void testCovariantEqualsInEnum() throws Exception { ++ void covariantEqualsInEnum() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCovariantEqualsInEnum.java")); + +@@ -67,7 +67,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/ENUM_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInEnum']]" + + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); +@@ -76,7 +76,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + } + + @Test +- public void testCovariantEqualsInRecord() throws Exception { ++ void covariantEqualsInRecord() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionCovariantEqualsInRecord.java")); + +@@ -87,7 +87,7 @@ public class XpathRegressionCovariantEqualsTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/RECORD_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionCovariantEqualsInRecord']]" + + "/OBJBLOCK/METHOD_DEF/IDENT[@text='equals']"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java +index 03db891b7..b88879603 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCustomImportOrderTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSupport { ++final class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSupport { + + private final String checkName = CustomImportOrderCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCustomImportOrderOne.java")); + +@@ -54,13 +54,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); ++ ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCustomImportOrderTwo.java")); + +@@ -76,13 +76,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='File']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='File']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCustomImportOrderThree.java")); + +@@ -98,13 +98,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); ++ ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCustomImportOrderFour.java")); + +@@ -120,13 +120,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCustomImportOrderFive.java")); + +@@ -143,13 +143,13 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); ++ ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT[./DOT/IDENT[@text='PI']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testSix() throws Exception { ++ void six() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCustomImportOrderSix.java")); + +@@ -168,7 +168,7 @@ public class XpathRegressionCustomImportOrderTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='DetailAST']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCyclomaticComplexityTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCyclomaticComplexityTest.java +index 838027732..f8aec884d 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCyclomaticComplexityTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionCyclomaticComplexityTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSupport { ++final class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSupport { + + private final String checkName = CyclomaticComplexityCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSu + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCyclomaticComplexityOne.java")); +@@ -66,7 +66,7 @@ public class XpathRegressionCyclomaticComplexityTest extends AbstractXpathTestSu + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionCyclomaticComplexityTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDeclarationOrderTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDeclarationOrderTest.java +index 942644a52..c7d2437df 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDeclarationOrderTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDeclarationOrderTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSupport { ++final class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSupport { + + private final String checkName = DeclarationOrderCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSuppor + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionDeclarationOrderOne.java")); + +@@ -62,7 +62,7 @@ public class XpathRegressionDeclarationOrderTest extends AbstractXpathTestSuppor + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionDeclarationOrderTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.java +index f2291e753..c5a097994 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionDefaultComesLastTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSupport { ++final class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSupport { + + private final String checkName = DefaultComesLastCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionDefaultComesLastOne.java")); + +@@ -62,7 +62,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionDefaultComesLastTwo.java")); + +@@ -77,7 +77,7 @@ public class XpathRegressionDefaultComesLastTest extends AbstractXpathTestSuppor + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionDefaultComesLastTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_SWITCH/CASE_GROUP" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java +index 165c9dce8..160e71515 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyBlockTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { ++final class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { + private final String checkName = EmptyBlockCheck.class.getSimpleName(); + + @Override +@@ -35,7 +35,7 @@ public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEmptyForLoopEmptyBlock() throws Exception { ++ void emptyForLoopEmptyBlock() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyBlockEmpty.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyBlockCheck.class); + moduleConfig.addProperty("option", "TEXT"); +@@ -43,7 +43,7 @@ public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { + "5:38: " + getCheckMessage(EmptyBlockCheck.class, EmptyBlockCheck.MSG_KEY_BLOCK_EMPTY, "for"), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyBlockEmpty']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='emptyLoop']]" +@@ -52,14 +52,14 @@ public class XpathRegressionEmptyBlockTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEmptyForLoopEmptyStatement() throws Exception { ++ void emptyForLoopEmptyStatement() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyBlockEmpty.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyBlockCheck.class); + final String[] expectedViolation = { + "5:38: " + getCheckMessage(EmptyBlockCheck.class, EmptyBlockCheck.MSG_KEY_BLOCK_NO_STATEMENT), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyBlockEmpty']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='emptyLoop']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java +index 30db3bedd..0d092763b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyCatchBlockTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport { ++final class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport { + + private final Class clazz = EmptyCatchBlockCheck.class; + +@@ -36,7 +36,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyCatchBlock1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); +@@ -46,7 +46,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionEmptyCatchBlock1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='main']]" +@@ -56,7 +56,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyCatchBlock2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); +@@ -66,7 +66,7 @@ public class XpathRegressionEmptyCatchBlockTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionEmptyCatchBlock2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='main']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForInitializerPadTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForInitializerPadTest.java +index e6820eaa7..cb1318dcf 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForInitializerPadTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForInitializerPadTest.java +@@ -27,7 +27,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTestSupport { ++final class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTestSupport { + + private final String checkName = EmptyForInitializerPadCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTest + } + + @Test +- public void testPreceded() throws Exception { ++ void preceded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyForInitializerPadPreceded.java")); + +@@ -62,7 +62,7 @@ public class XpathRegressionEmptyForInitializerPadTest extends AbstractXpathTest + } + + @Test +- public void testNotPreceded() throws Exception { ++ void notPreceded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyForInitializerPadNotPreceded.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java +index 9d1e1c601..3afba91bf 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyForIteratorPadTest.java +@@ -27,7 +27,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSupport { ++final class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSupport { + + private final String checkName = EmptyForIteratorPadCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSup + } + + @Test +- public void testFollowed() throws Exception { ++ void followed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadFollowed.java")); + +@@ -62,7 +62,7 @@ public class XpathRegressionEmptyForIteratorPadTest extends AbstractXpathTestSup + } + + @Test +- public void testNotFollowed() throws Exception { ++ void notFollowed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyForIteratorPadNotFollowed.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.java +index 603f57a39..43ad55243 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyLineSeparatorTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupport { ++final class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -35,7 +35,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyLineSeparator1.java")); + +@@ -57,7 +57,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyLineSeparator2.java")); + +@@ -77,7 +77,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyLineSeparator3.java")); + +@@ -110,7 +110,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyLineSeparator4.java")); + +@@ -124,7 +124,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionEmptyLineSeparator4']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo1']]/SLIST/RCURLY"); +@@ -133,7 +133,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEmptyLineSeparator5.java")); + +@@ -148,7 +148,7 @@ public class XpathRegressionEmptyLineSeparatorTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionEmptyLineSeparator5']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo1']]/SLIST/LITERAL_TRY/SLIST" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java +index 0083a6ac1..f9e9fb97c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEmptyStatementTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport { ++final class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport { + + private final String checkName = EmptyStatementCheck.class.getSimpleName(); + +@@ -36,14 +36,14 @@ public class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport + } + + @Test +- public void testForLoopEmptyStatement() throws Exception { ++ void forLoopEmptyStatement() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyStatement1.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyStatementCheck.class); + final String[] expectedViolation = { + "5:36: " + getCheckMessage(EmptyStatementCheck.class, EmptyStatementCheck.MSG_KEY), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyStatement1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" +@@ -52,14 +52,14 @@ public class XpathRegressionEmptyStatementTest extends AbstractXpathTestSupport + } + + @Test +- public void testIfBlockEmptyStatement() throws Exception { ++ void ifBlockEmptyStatement() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEmptyStatement2.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(EmptyStatementCheck.class); + final String[] expectedViolation = { + "6:19: " + getCheckMessage(EmptyStatementCheck.class, EmptyStatementCheck.MSG_KEY), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionEmptyStatement2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsAvoidNullTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsAvoidNullTest.java +index ec4ea9181..102e4b3e0 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsAvoidNullTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionEqualsAvoidNullTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport { ++final class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport { + + private final Class clazz = EqualsAvoidNullCheck.class; + +@@ -36,7 +36,7 @@ public class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport + } + + @Test +- public void testEquals() throws Exception { ++ void testEquals() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionEqualsAvoidNull.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(clazz); +@@ -58,7 +58,7 @@ public class XpathRegressionEqualsAvoidNullTest extends AbstractXpathTestSupport + } + + @Test +- public void testEqualsIgnoreCase() throws Exception { ++ void equalsIgnoreCase() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionEqualsAvoidNullIgnoreCase.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java +index 52f230ae1..b9bc435f2 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionExplicitInitializationTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionExplicitInitializationTest extends AbstractXpathTestSupport { ++final class XpathRegressionExplicitInitializationTest extends AbstractXpathTestSupport { + + private final String checkName = ExplicitInitializationCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionExplicitInitializationOne.java")); + +@@ -49,7 +49,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionExplicitInitializationOne']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='a']"); +@@ -58,7 +58,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionExplicitInitializationTwo.java")); + +@@ -74,7 +74,7 @@ public class XpathRegressionExplicitInitializationTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionExplicitInitializationTwo']]" + + "/OBJBLOCK/VARIABLE_DEF/IDENT[@text='bar']"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFallThroughTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFallThroughTest.java +index 896db2bba..7ad95be5b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFallThroughTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFallThroughTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { ++final class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { + + private final String checkName = FallThroughCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionFallThroughOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(FallThroughCheck.class); +@@ -59,7 +59,7 @@ public class XpathRegressionFallThroughTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionFallThroughTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(FallThroughCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalClassTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalClassTest.java +index 0367a817f..92ffee8c7 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalClassTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionFinalClassTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { ++final class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { + private final String checkName = FinalClassCheck.class.getSimpleName(); + + @Override +@@ -35,7 +35,7 @@ public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalClass1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(FinalClassCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionFinalClassTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionFinalClass2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(FinalClassCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.java +index 006911da3..3db2e55c0 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionGenericWhitespaceTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSupport { ++final class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSupport { + + private final String checkName = GenericWhitespaceCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessEnd() throws Exception { ++ void processEnd() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceEnd.java")); + +@@ -50,7 +50,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionGenericWhitespaceEnd']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='bad']]" +@@ -61,7 +61,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessNestedGenericsOne() throws Exception { ++ void processNestedGenericsOne() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne.java")); + +@@ -74,7 +74,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsOne']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" +@@ -85,7 +85,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessNestedGenericsTwo() throws Exception { ++ void processNestedGenericsTwo() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo.java")); + +@@ -98,7 +98,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsTwo']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" +@@ -109,7 +109,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessNestedGenericsThree() throws Exception { ++ void processNestedGenericsThree() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree.java")); + +@@ -122,7 +122,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionGenericWhitespaceNestedGenericsThree']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS" +@@ -133,7 +133,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessSingleGenericOne() throws Exception { ++ void processSingleGenericOne() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericOne.java")); + +@@ -146,7 +146,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionGenericWhitespaceSingleGenericOne']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/METHOD_CALL" +@@ -157,7 +157,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessSingleGenericTwo() throws Exception { ++ void processSingleGenericTwo() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo.java")); + +@@ -170,7 +170,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionGenericWhitespaceSingleGenericTwo']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bad']]/TYPE_PARAMETERS/GENERIC_END"); +@@ -179,7 +179,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessStartOne() throws Exception { ++ void processStartOne() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartOne.java")); + +@@ -204,7 +204,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessStartTwo() throws Exception { ++ void processStartTwo() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartTwo.java")); + +@@ -233,7 +233,7 @@ public class XpathRegressionGenericWhitespaceTest extends AbstractXpathTestSuppo + } + + @Test +- public void testProcessStartThree() throws Exception { ++ void processStartThree() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionGenericWhitespaceStartThree.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java +index c2b9ae8c8..4106f75fd 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionHiddenFieldTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { ++final class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { + + private final String checkName = HiddenFieldCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionHiddenFieldOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(HiddenFieldCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionHiddenFieldOne']]/OBJBLOCK" + + "/INSTANCE_INIT/SLIST/EXPR/METHOD_CALL/ELIST/LAMBDA/PARAMETERS" +@@ -56,7 +56,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionHiddenFieldTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(HiddenFieldCheck.class); +@@ -66,7 +66,7 @@ public class XpathRegressionHiddenFieldTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionHiddenFieldTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='method']]/PARAMETERS/PARAMETER_DEF" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java +index 3ebd4ce71..0dde1be75 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalCatchTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { ++final class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { + + private final String checkName = IllegalCatchCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalCatchOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalCatchCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIllegalCatchOne']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='fun']]/SLIST" +@@ -57,7 +57,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalCatchTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalCatchCheck.class); +@@ -69,7 +69,7 @@ public class XpathRegressionIllegalCatchTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIllegalCatchTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='methodTwo']]/SLIST" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java +index 55b0a8127..02d2c8462 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalIdentifierNameTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.IllegalIdentifierNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestSupport { + + private final String checkName = IllegalIdentifierNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File( + getNonCompilablePath("SuppressionXpathRegressionIllegalIdentifierNameTestOne.java")); +@@ -56,7 +56,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/RECORD_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIllegalIdentifierNameTestOne'" + + "]]/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='yield']"); +@@ -65,7 +65,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File( + getNonCompilablePath("SuppressionXpathRegressionIllegalIdentifierNameTestTwo.java")); +@@ -84,7 +84,7 @@ public class XpathRegressionIllegalIdentifierNameTest extends AbstractXpathTestS + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIllegalIdentifierNameTestTwo']" + + "]/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]/PARAMETERS/PARAMETER_DEF" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java +index 820d0e83c..91d99df6b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalImportTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { ++final class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { + + private final String checkName = IllegalImportCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalImportOne.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalImportCheck.class); + moduleConfig.addProperty("illegalPkgs", "java.util"); +@@ -44,13 +44,13 @@ public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { + "3:1: " + + getCheckMessage(IllegalImportCheck.class, IllegalImportCheck.MSG_KEY, "java.util.List"), + }; +- final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalImportTwo.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalImportCheck.class); + +@@ -61,8 +61,7 @@ public class XpathRegressionIllegalImportTest extends AbstractXpathTestSupport { + + getCheckMessage( + IllegalImportCheck.class, IllegalImportCheck.MSG_KEY, "java.lang.Math.pow"), + }; +- final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalThrowsTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalThrowsTest.java +index 88336d5c8..2d525ef8b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalThrowsTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalThrowsTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { ++final class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { + + private final String checkName = IllegalThrowsCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalThrowsOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalThrowsCheck.class); +@@ -48,7 +48,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIllegalThrowsOne']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='sayHello']]/LITERAL_THROWS" +@@ -58,7 +58,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalThrowsTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalThrowsCheck.class); +@@ -70,7 +70,7 @@ public class XpathRegressionIllegalThrowsTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIllegalThrowsTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='methodTwo']]/LITERAL_THROWS" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java +index 00d9de121..74fa64222 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTokenTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { ++final class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { + + private final String checkName = IllegalTokenCheck.class.getSimpleName(); + +@@ -36,14 +36,14 @@ public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalToken1.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); + final String[] expectedViolation = { + "5:10: " + getCheckMessage(IllegalTokenCheck.class, IllegalTokenCheck.MSG_KEY, "outer:"), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalToken1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myTest']]" +@@ -53,7 +53,7 @@ public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalToken2.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTokenCheck.class); + +@@ -63,7 +63,7 @@ public class XpathRegressionIllegalTokenTest extends AbstractXpathTestSupport { + "4:10: " + getCheckMessage(IllegalTokenCheck.class, IllegalTokenCheck.MSG_KEY, "native"), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalToken2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myTest']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java +index 23a92991a..fc93329d2 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIllegalTypeTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { ++final class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { + + private final String checkName = IllegalTypeCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalTypeOne.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTypeCheck.class); + moduleConfig.addProperty("tokens", "METHOD_DEF"); +@@ -45,7 +45,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { + + getCheckMessage(IllegalTypeCheck.class, IllegalTypeCheck.MSG_KEY, "java.util.HashSet"), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalTypeOne']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='typeParam']]/TYPE_PARAMETERS/TYPE_PARAMETER" +@@ -56,7 +56,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionIllegalTypeTwo.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(IllegalTypeCheck.class); + +@@ -66,7 +66,7 @@ public class XpathRegressionIllegalTypeTest extends AbstractXpathTestSupport { + "6:20: " + getCheckMessage(IllegalTypeCheck.class, IllegalTypeCheck.MSG_KEY, "Boolean"), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionIllegalTypeTwo']" + + "]/OBJBLOCK/METHOD_DEF[./IDENT[@text='typeParam']]/TYPE_PARAMETERS/" + + "TYPE_PARAMETER[./IDENT[@text='T']]/TYPE_UPPER_BOUNDS/IDENT[@text='Boolean']"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportControlTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportControlTest.java +index c2e707338..11ccadf09 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportControlTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportControlTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.ImportControlCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { ++final class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + + private final String checkName = ImportControlCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); +@@ -49,13 +49,13 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + ImportControlCheck.class, ImportControlCheck.MSG_DISALLOWED, "java.util.Scanner"), + }; + +- final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportControlTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(ImportControlCheck.class); +@@ -72,7 +72,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionImportControlThree.java")); + +@@ -89,7 +89,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionImportControlFour.java")); + +@@ -103,7 +103,7 @@ public class XpathRegressionImportControlTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportOrderTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportOrderTest.java +index 318616c6b..341a8b3fc 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportOrderTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionImportOrderTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { ++final class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + + private final String checkName = ImportOrderCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); +@@ -46,13 +46,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + + getCheckMessage(ImportOrderCheck.class, ImportOrderCheck.MSG_ORDERING, "java.util.Set"), + }; + +- final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); +@@ -64,13 +64,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Set']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Set']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderThree.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); +@@ -83,13 +83,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/DOT/IDENT[@text='org']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/DOT/IDENT[@text='org']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderFour.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); +@@ -101,14 +101,13 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + ImportOrderCheck.class, ImportOrderCheck.MSG_ORDERING, "java.lang.Math.PI"), + }; + +- final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/STATIC_IMPORT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/STATIC_IMPORT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionImportOrderFive.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(ImportOrderCheck.class); +@@ -121,7 +120,7 @@ public class XpathRegressionImportOrderTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Date']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Date']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIndentationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIndentationTest.java +index 7e0a9261c..7cfc2a68e 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIndentationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionIndentationTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { ++final class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + private final String checkName = IndentationCheck.class.getSimpleName(); + + @Override +@@ -36,7 +36,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIndentationTestOne.java")); + +@@ -67,7 +67,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + } + + @Test +- public void testBasicOffset() throws Exception { ++ void basicOffset() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIndentationTestTwo.java")); + +@@ -106,7 +106,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + } + + @Test +- public void testCaseIndent() throws Exception { ++ void caseIndent() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIndentationTestThree.java")); + +@@ -141,7 +141,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + } + + @Test +- public void testLambda() throws Exception { ++ void lambda() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIndentationLambdaTest1.java")); + +@@ -160,7 +160,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIndentationLambdaTest1" + + "']]/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF" +@@ -170,7 +170,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + } + + @Test +- public void testLambda2() throws Exception { ++ void lambda2() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIndentationLambdaTest2.java")); + +@@ -195,7 +195,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIndentationLambdaTest2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[" +@@ -205,7 +205,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + } + + @Test +- public void testIfWithNoCurlies() throws Exception { ++ void ifWithNoCurlies() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIndentationIfWithoutCurly.java")); + +@@ -226,7 +226,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIndentationIfWithoutCurly']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/EXPR/" +@@ -236,7 +236,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + } + + @Test +- public void testElseWithNoCurlies() throws Exception { ++ void elseWithNoCurlies() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionIndentationElseWithoutCurly.java")); + +@@ -258,7 +258,7 @@ public class XpathRegressionIndentationTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionIndentationElseWithoutCurly']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/LITERAL_ELSE" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceIsTypeTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceIsTypeTest.java +index 07a1367b2..9f5ce8763 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceIsTypeTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceIsTypeTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport { ++final class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport { + + private final String checkName = InterfaceIsTypeCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceIsType1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(InterfaceIsTypeCheck.class); +@@ -59,7 +59,7 @@ public class XpathRegressionInterfaceIsTypeTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionInterfaceIsType2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(InterfaceIsTypeCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceMemberImpliedModifierTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceMemberImpliedModifierTest.java +index 02a7a3356..b554c8d90 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceMemberImpliedModifierTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInterfaceMemberImpliedModifierTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractXpathTestSupport { ++final class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier1.java")); + +@@ -67,7 +67,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier2.java")); + +@@ -100,7 +100,7 @@ public class XpathRegressionInterfaceMemberImpliedModifierTest extends AbstractX + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInterfaceMemberImpliedModifier3.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java +index f4d2a7a19..45c72ba26 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionInvalidJavadocPositionTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.InvalidJavadocPositionCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTestSupport { ++final class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTestSupport { + + private final String checkName = InvalidJavadocPositionCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionOne.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionOne']]" + + "/MODIFIERS/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" +@@ -58,7 +58,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionTwo.java")); + +@@ -70,7 +70,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionInvalidJavadocPositionTwo']]" + + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" +@@ -80,7 +80,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionThree.java")); + +@@ -92,7 +92,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionThree']]/" + + "OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" +@@ -102,7 +102,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionFour.java")); + +@@ -114,7 +114,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionFour']]" + + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" +@@ -124,7 +124,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionFive.java")); + +@@ -136,7 +136,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionFive']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" +@@ -147,7 +147,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + } + + @Test +- public void testSix() throws Exception { ++ void six() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionInvalidJavadocPositionSix.java")); + +@@ -159,7 +159,7 @@ public class XpathRegressionInvalidJavadocPositionTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionInvalidJavadocPositionSix']]" + + "/OBJBLOCK/BLOCK_COMMENT_BEGIN[./COMMENT_CONTENT" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java +index 31d9f38da..f2b76fabb 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocContentLocationTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocContentLocationCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTestSupport { ++final class XpathRegressionJavadocContentLocationTest extends AbstractXpathTestSupport { + + private final String checkName = JavadocContentLocationCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionJavadocContentLocationOne.java")); + +@@ -50,7 +50,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/INTERFACE_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionJavadocContentLocationOne']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/TYPE/BLOCK_COMMENT_BEGIN" +@@ -60,7 +60,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionJavadocContentLocationTwo.java")); + +@@ -76,7 +76,7 @@ public class XpathRegressionJavadocContentLocationTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/INTERFACE_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionJavadocContentLocationTwo']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/TYPE/BLOCK_COMMENT_BEGIN" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocMethodTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocMethodTest.java +index a2b22327b..f02ea6282 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocMethodTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocMethodTest.java +@@ -22,15 +22,15 @@ package org.checkstyle.suppressionxpathfilter; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.MSG_EXPECTED_TAG; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck.MSG_INVALID_INHERIT_DOC; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { ++final class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + + private final String checkName = JavadocMethodCheck.class.getSimpleName(); + +@@ -40,7 +40,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); +@@ -66,7 +66,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocMethodTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocMethodCheck.class); +@@ -76,7 +76,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionJavadocMethodTwo']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='checkParam']]/PARAMETERS" +@@ -86,7 +86,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionJavadocMethodThree.java")); + +@@ -111,7 +111,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionJavadocMethodFour.java")); + +@@ -125,7 +125,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionJavadocMethodFour']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" +@@ -135,7 +135,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionJavadocMethodFive.java")); + +@@ -153,7 +153,7 @@ public class XpathRegressionJavadocMethodTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionJavadocMethodFive']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='bar']]/SLIST" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocTypeTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocTypeTest.java +index 4687c52b5..56f251ce3 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocTypeTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocTypeTest.java +@@ -30,7 +30,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { ++final class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { + + private final String checkName = JavadocTypeCheck.class.getSimpleName(); + +@@ -40,7 +40,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); +@@ -66,7 +66,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); +@@ -91,7 +91,7 @@ public class XpathRegressionJavadocTypeTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionJavadocTypeThree.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(JavadocTypeCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocVariableTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocVariableTest.java +index 9240dc090..7ad130eb8 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocVariableTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionJavadocVariableTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport { ++final class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport { + + private final String checkName = JavadocVariableCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionJavadocVariableOne.java")); + +@@ -63,7 +63,7 @@ public class XpathRegressionJavadocVariableTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionJavadocVariableTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java +index 5441888d4..cb98b7a87 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaBodyLengthTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.sizes.LambdaBodyLengthCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSupport { ++final class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSupport { + + private static final Class CLASS = LambdaBodyLengthCheck.class; + +@@ -36,7 +36,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionLambdaBodyLength1.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -45,7 +45,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionLambdaBodyLength1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST" +@@ -55,7 +55,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor + } + + @Test +- public void testMaxIsNotDefault() throws Exception { ++ void maxIsNotDefault() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionLambdaBodyLength2.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(CLASS); +@@ -65,7 +65,7 @@ public class XpathRegressionLambdaBodyLengthTest extends AbstractXpathTestSuppor + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionLambdaBodyLength2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java +index a64abfd47..5ca2e9ac7 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLambdaParameterNameTest.java +@@ -19,16 +19,16 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSupport { + + private final String checkName = LambdaParameterNameCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionLambdaParameterName1.java")); + +@@ -55,7 +55,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionLambdaParameterName1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/VARIABLE_DEF[" +@@ -65,7 +65,7 @@ public class XpathRegressionLambdaParameterNameTest extends AbstractXpathTestSup + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionLambdaParameterName2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java +index 15bebc120..6f8e1bf60 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionLeftCurlyTest.java +@@ -19,16 +19,16 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck; + import com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyOption; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { ++final class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { + + private final String checkName = LeftCurlyCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionLeftCurlyOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); +@@ -58,7 +58,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionLeftCurlyTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); +@@ -79,7 +79,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionLeftCurlyThree.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(LeftCurlyCheck.class); +@@ -90,7 +90,7 @@ public class XpathRegressionLeftCurlyTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionLeftCurlyThree']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java +index 3f72ddf3b..f49d94157 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMatchXpathTest.java +@@ -19,16 +19,16 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck; + import com.puppycrawl.tools.checkstyle.checks.coding.MatchXpathCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { ++final class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + + private final String checkName = MatchXpathCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); +@@ -75,7 +75,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionMatchXpathTwo']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='func1']]" +@@ -85,7 +85,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedQuoteString() throws Exception { ++ void encodedQuoteString() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedQuoteString.java")); + +@@ -113,7 +113,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedLessString() throws Exception { ++ void encodedLessString() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedLessString.java")); + +@@ -140,7 +140,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedNewLineString() throws Exception { ++ void encodedNewLineString() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedNewLineString.java")); + +@@ -167,7 +167,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testGreaterString() throws Exception { ++ void greaterString() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedGreaterString.java")); + +@@ -194,7 +194,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedAmpString() throws Exception { ++ void encodedAmpString() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAmpString.java")); + +@@ -221,7 +221,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedAposString() throws Exception { ++ void encodedAposString() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAposString.java")); + +@@ -249,7 +249,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedCarriageString() throws Exception { ++ void encodedCarriageString() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedCarriageString.java")); + +@@ -277,7 +277,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedAmpersandChars() throws Exception { ++ void encodedAmpersandChars() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAmpChar.java")); + +@@ -307,7 +307,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedQuoteChar() throws Exception { ++ void encodedQuoteChar() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedQuotChar.java")); + +@@ -334,7 +334,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedLessChar() throws Exception { ++ void encodedLessChar() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedLessChar.java")); + +@@ -361,7 +361,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedAposChar() throws Exception { ++ void encodedAposChar() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedAposChar.java")); + +@@ -388,7 +388,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEncodedGreaterChar() throws Exception { ++ void encodedGreaterChar() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMatchXpathEncodedGreaterChar.java")); + +@@ -417,7 +417,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + } + + @Test +- public void testFollowing() throws Exception { ++ void following() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMatchXpathThree.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MatchXpathCheck.class); +@@ -428,7 +428,7 @@ public class XpathRegressionMatchXpathTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionMatchXpathThree']]" + + "/OBJBLOCK/RCURLY"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java +index a4ba88873..39abffa92 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMemberNameTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { + + private final String checkName = MemberNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void test1() throws Exception { ++ void test1() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMemberName1.java")); + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; +@@ -50,7 +50,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionMemberName1']]" +@@ -59,7 +59,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void test2() throws Exception { ++ void test2() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMemberName2.java")); + + final String pattern = "^m[A-Z][a-zA-Z0-9]*$"; +@@ -75,7 +75,7 @@ public class XpathRegressionMemberNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionMemberName2']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java +index f95715ab2..bbcd56155 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodCountTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { ++final class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); +@@ -59,7 +59,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); +@@ -84,7 +84,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); +@@ -109,7 +109,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount3.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); +@@ -135,7 +135,7 @@ public class XpathRegressionMethodCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodCount4.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MethodCountCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java +index f64f77ef1..9b6c5c361 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodNameTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { + + private final String checkName = MethodNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void test1() throws Exception { ++ void test1() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodName1.java")); + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; +@@ -53,7 +53,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionMethodName1']]" +@@ -62,7 +62,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void test2() throws Exception { ++ void test2() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodName2.java")); + + final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; +@@ -76,7 +76,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionMethodName2']]" +@@ -86,7 +86,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void test3() throws Exception { ++ void test3() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMethodName3.java")); + + final String pattern = "^[a-z](_?[a-zA-Z0-9]+)*$"; +@@ -102,7 +102,7 @@ public class XpathRegressionMethodNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/INTERFACE_DEF[./IDENT[@text='Check']]" + + "/OBJBLOCK/METHOD_DEF/IDENT[@text='ThirdMethod']"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodParamPadTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodParamPadTest.java +index 119e4583d..e8cbf2180 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodParamPadTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMethodParamPadTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport { ++final class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport { + + private final String checkName = MethodParamPadCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMethodParamPadOne.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionMethodParamPadOne']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='InputMethodParamPad']]/LPAREN"); +@@ -57,7 +57,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMethodParamPadTwo.java")); + +@@ -69,7 +69,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionMethodParamPadTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='sayHello']]/LPAREN"); +@@ -78,7 +78,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMethodParamPadThree.java")); + +@@ -92,7 +92,7 @@ public class XpathRegressionMethodParamPadTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionMethodParamPadThree']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='sayHello']]/LPAREN"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingCtorTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingCtorTest.java +index 1da3af9bc..9048df34b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingCtorTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingCtorTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { ++final class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { + + private final String checkName = MissingCtorCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingCtor1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MissingCtorCheck.class); +@@ -58,7 +58,7 @@ public class XpathRegressionMissingCtorTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionMissingCtor2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MissingCtorCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocMethodTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocMethodTest.java +index 934f857ff..3fa6aca2a 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocMethodTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocMethodTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSupport { ++final class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSu + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingJavadocMethod1.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionMissingJavadocMethodTest extends AbstractXpathTestSu + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingJavadocMethod2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocPackageTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocPackageTest.java +index 390ca3541..bedcfc0a5 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocPackageTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocPackageTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestSupport { ++final class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestSupport { + + private final String checkName = MissingJavadocPackageCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestS + } + + @Test +- public void testBlockComment() throws Exception { ++ void blockComment() throws Exception { + final File fileToProcess = new File(getPath("blockcomment/package-info.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocPackageCheck.class); +@@ -53,7 +53,7 @@ public class XpathRegressionMissingJavadocPackageTest extends AbstractXpathTestS + } + + @Test +- public void testNoJavadoc() throws Exception { ++ void noJavadoc() throws Exception { + final File fileToProcess = new File(getPath("nojavadoc/package-info.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(MissingJavadocPackageCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocTypeTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocTypeTest.java +index 20545f25b..c8e9e4587 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocTypeTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingJavadocTypeTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupport { ++final class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupport { + + private final String checkName = MissingJavadocTypeCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + } + + @Test +- public void testClass() throws Exception { ++ void testClass() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingJavadocTypeClass.java")); + +@@ -65,7 +65,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + } + + @Test +- public void testScope() throws Exception { ++ void scope() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingJavadocTypeScope.java")); + +@@ -96,7 +96,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + } + + @Test +- public void testExcluded() throws Exception { ++ void excluded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingJavadocTypeExcluded.java")); + +@@ -128,7 +128,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingJavadocTypeAnnotation.java")); + +@@ -164,7 +164,7 @@ public class XpathRegressionMissingJavadocTypeTest extends AbstractXpathTestSupp + } + + @Test +- public void testToken() throws Exception { ++ void token() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingJavadocTypeToken.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java +index 68b323dba..30398a8f0 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingOverrideTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport { ++final class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport { + + private final String checkName = MissingOverrideCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + } + + @Test +- public void testClass() throws Exception { ++ void testClass() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingOverrideClass.java")); + +@@ -64,7 +64,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + } + + @Test +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingOverrideInterface.java")); + +@@ -95,7 +95,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + } + + @Test +- public void testAnonymous() throws Exception { ++ void anonymous() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingOverrideAnonymous.java")); + +@@ -129,7 +129,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + } + + @Test +- public void testInheritDocInvalid1() throws Exception { ++ void inheritDocInvalid1() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingOverrideInheritDocInvalid1.java")); + +@@ -159,7 +159,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + } + + @Test +- public void testInheritDocInvalid2() throws Exception { ++ void inheritDocInvalid2() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingOverrideInheritDocInvalid2.java")); + +@@ -189,7 +189,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + } + + @Test +- public void testJavaFiveCompatibility1() throws Exception { ++ void javaFiveCompatibility1() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingOverrideClass.java")); + +@@ -218,7 +218,7 @@ public class XpathRegressionMissingOverrideTest extends AbstractXpathTestSupport + } + + @Test +- public void testJavaFiveCompatibility2() throws Exception { ++ void javaFiveCompatibility2() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingOverrideInterface.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.java +index bb8c2fb5b..f29a6ae7b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMissingSwitchDefaultTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSupport { ++final class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSupport { + + private final Class clss = MissingSwitchDefaultCheck.class; + +@@ -37,7 +37,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingSwitchDefaultOne.java")); + +@@ -47,7 +47,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionMissingSwitchDefaultOne']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test1']]" +@@ -57,7 +57,7 @@ public class XpathRegressionMissingSwitchDefaultTest extends AbstractXpathTestSu + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMissingSwitchDefaultTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.java +index d3f345847..3e6cbe191 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionModifierOrderTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { ++final class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { + + private final Class clazz = ModifierOrderCheck.class; + +@@ -37,7 +37,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { + } + + @Test +- public void testMethod() throws Exception { ++ void method() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionModifierOrderMethod.java")); + +@@ -63,7 +63,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { + } + + @Test +- public void testVariable() throws Exception { ++ void variable() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionModifierOrderVariable.java")); + +@@ -74,7 +74,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionModifierOrderVariable']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='var']]/MODIFIERS/LITERAL_PRIVATE"); +@@ -83,7 +83,7 @@ public class XpathRegressionModifierOrderTest extends AbstractXpathTestSupport { + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionModifierOrderAnnotation.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleVariableDeclarationsTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleVariableDeclarationsTest.java +index ee6221ee8..f996be64c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleVariableDeclarationsTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionMultipleVariableDeclarationsTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpathTestSupport { ++final class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpathTestSupport { + + private final String checkName = MultipleVariableDeclarationsCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpa + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMultipleVariableDeclarationsOne.java")); + +@@ -81,7 +81,7 @@ public class XpathRegressionMultipleVariableDeclarationsTest extends AbstractXpa + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionMultipleVariableDeclarationsTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java +index 01e5d276e..942bb645c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNPathComplexityTest.java +@@ -19,16 +19,16 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + + // -@cs[AbbreviationAsWordInName] Test should be named as its main class. +-public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport { ++final class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport { + + private final String checkName = NPathComplexityCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNPathComplexityOne.java")); + +@@ -65,7 +65,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNPathComplexityTwo.java")); + +@@ -77,7 +77,7 @@ public class XpathRegressionNPathComplexityTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNPathComplexityTwo']]" + + "/OBJBLOCK/STATIC_INIT"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java +index ed092cedc..88e8e58ab 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNeedBracesTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck.MSG_KEY_NEED_BRACES; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { ++final class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + private final String checkName = NeedBracesCheck.class.getSimpleName(); + + @Override +@@ -37,7 +37,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + } + + @Test +- public void testDo() throws Exception { ++ void testDo() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNeedBracesDo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NeedBracesCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesDo']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_DO"); +@@ -56,7 +56,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + } + + @Test +- public void testSingleLine() throws Exception { ++ void singleLine() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNeedBracesSingleLine.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesSingleLine']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF"); +@@ -77,7 +77,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + } + + @Test +- public void testSingleLineLambda() throws Exception { ++ void singleLineLambda() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNeedBracesSingleLineLambda.java")); + +@@ -90,7 +90,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesSingleLineLambda']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='r3']]/ASSIGN/LAMBDA"); +@@ -99,7 +99,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + } + + @Test +- public void testEmptyLoopBody() throws Exception { ++ void emptyLoopBody() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNeedBracesEmptyLoopBody.java")); + +@@ -110,7 +110,7 @@ public class XpathRegressionNeedBracesTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNeedBracesEmptyLoopBody']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_WHILE"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java +index 5aa1b86af..7a301cf05 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedForDepthTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport { ++final class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport { + + private final String checkName = NestedForDepthCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedForDepth.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NestedForDepthCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNestedForDepth']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_FOR" +@@ -56,7 +56,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport + } + + @Test +- public void testMax() throws Exception { ++ void max() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNestedForDepthMax.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionNestedForDepthTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNestedForDepthMax']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java +index bfb32bb05..e50234a59 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedIfDepthTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { ++final class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { + + private final String checkName = NestedIfDepthCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedIfDepth.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NestedIfDepthCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNestedIfDepth']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF" +@@ -56,7 +56,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { + } + + @Test +- public void testMax() throws Exception { ++ void max() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedIfDepthMax.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NestedIfDepthCheck.class); +@@ -67,7 +67,7 @@ public class XpathRegressionNestedIfDepthTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNestedIfDepthMax']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java +index fe0ad3dfa..e29fe9de8 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNestedTryDepthTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport { ++final class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport { + + private final String checkName = NestedTryDepthCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNestedTryDepth.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NestedTryDepthCheck.class); +@@ -46,7 +46,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNestedTryDepth']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_TRY/SLIST" +@@ -56,7 +56,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport + } + + @Test +- public void testMax() throws Exception { ++ void max() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNestedTryDepthMax.java")); + +@@ -68,7 +68,7 @@ public class XpathRegressionNestedTryDepthTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNestedTryDepthMax']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java +index ce538ac14..ecf72a019 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoArrayTrailingCommaTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingCommaCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSupport { ++final class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSupport { + + private final String checkName = NoArrayTrailingCommaCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoArrayTrailingCommaOne.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text='SuppressionXpathRegressionNoArrayTrailingCommaOne']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='t1']]/ASSIGN/EXPR" +@@ -58,7 +58,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoArrayTrailingCommaTwo.java")); + +@@ -70,7 +70,7 @@ public class XpathRegressionNoArrayTrailingCommaTest extends AbstractXpathTestSu + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNoArrayTrailingCommaTwo']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='t4']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoCloneTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoCloneTest.java +index fe6f18467..bd1b15d12 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoCloneTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoCloneTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { ++final class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { + + private final String checkName = NoCloneCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoCloneOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NoCloneCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionNoCloneTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoCloneTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NoCloneCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoEnumTrailingCommaTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoEnumTrailingCommaTest.java +index e8394e7b1..055e75b89 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoEnumTrailingCommaTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoEnumTrailingCommaTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.NoEnumTrailingCommaCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSupport { ++final class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSupport { + + private final String checkName = NoEnumTrailingCommaCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoEnumTrailingCommaOne.java")); + +@@ -47,7 +47,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNoEnumTrailingCommaOne']]" + + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Foo3']]/OBJBLOCK/COMMA[2]"); +@@ -56,7 +56,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoEnumTrailingCommaTwo.java")); + +@@ -67,7 +67,7 @@ public class XpathRegressionNoEnumTrailingCommaTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNoEnumTrailingCommaTwo']]" + + "/OBJBLOCK/ENUM_DEF[./IDENT[@text='Foo6']]/OBJBLOCK/COMMA[2]"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoFinalizerTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoFinalizerTest.java +index fb0d0b921..8b226606e 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoFinalizerTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoFinalizerTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { ++final class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoFinalizer1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NoFinalizerCheck.class); +@@ -59,7 +59,7 @@ public class XpathRegressionNoFinalizerTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoFinalizer2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NoFinalizerCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java +index 7f9a04aa3..25f6638c1 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoLineWrapTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { ++final class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -34,7 +34,7 @@ public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoLineWrap1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NoLineWrapCheck.class); +@@ -50,7 +50,7 @@ public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoLineWrap2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NoLineWrapCheck.class); +@@ -78,7 +78,7 @@ public class XpathRegressionNoLineWrapTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionNoLineWrap3.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(NoLineWrapCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceAfterTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceAfterTest.java +index 608817900..b99b77dd1 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceAfterTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceAfterTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSupport { ++final class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSupport { + + private final String checkName = NoWhitespaceAfterCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo + } + + @Test +- public void testNoWhitespaceAfter() throws Exception { ++ void noWhitespaceAfter() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceAfter.java")); + +@@ -61,7 +61,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo + } + + @Test +- public void testTokens() throws Exception { ++ void tokens() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceAfterTokens.java")); + +@@ -73,7 +73,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceAfterTokens']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +@@ -84,7 +84,7 @@ public class XpathRegressionNoWhitespaceAfterTest extends AbstractXpathTestSuppo + } + + @Test +- public void testAllowLineBreaks() throws Exception { ++ void allowLineBreaks() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceAfterLineBreaks.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java +index 508518b5f..51e771e20 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest.java +@@ -19,15 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest +- extends AbstractXpathTestSupport { ++final class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest extends AbstractXpathTestSupport { + + private final String checkName = NoWhitespaceBeforeCaseDefaultColonCheck.class.getSimpleName(); + +@@ -37,7 +36,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonOne.java")); + +@@ -53,7 +52,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonOne']]" + + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP/LITERAL_CASE/COLON"); +@@ -62,7 +61,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonTwo.java")); + +@@ -78,7 +77,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonTwo']]" + + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" +@@ -88,7 +87,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonThree.java")); + +@@ -104,7 +103,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonThree']]" + + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" +@@ -114,7 +113,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonFour.java")); + +@@ -130,7 +129,7 @@ public class XpathRegressionNoWhitespaceBeforeCaseDefaultColonTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionNoWhitespaceBeforeCaseDefaultColonFour']]" + + "/OBJBLOCK/INSTANCE_INIT/SLIST/LITERAL_SWITCH/CASE_GROUP" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java +index e782c8061..07b0c74ed 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionNoWhitespaceBeforeTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupport { ++final class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupport { + + private final String checkName = NoWhitespaceBeforeCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + } + + @Test +- public void testNoWhitespaceBefore() throws Exception { ++ void noWhitespaceBefore() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceBefore.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceBefore']]/OBJBLOCK" + + "/VARIABLE_DEF[./IDENT[@text='bad']]/SEMI"); +@@ -57,7 +57,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + } + + @Test +- public void testTokens() throws Exception { ++ void tokens() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeTokens.java")); + +@@ -70,7 +70,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceBeforeTokens']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +@@ -81,7 +81,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + } + + @Test +- public void testAllowLineBreaks() throws Exception { ++ void allowLineBreaks() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionNoWhitespaceBeforeLineBreaks.java")); + +@@ -94,7 +94,7 @@ public class XpathRegressionNoWhitespaceBeforeTest extends AbstractXpathTestSupp + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionNoWhitespaceBeforeLineBreaks']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java +index d27f87396..557c2a52f 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneStatementPerLineTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSupport { ++final class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSupport { + + private final String checkName = OneStatementPerLineCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOneStatementPerLineOne.java")); + +@@ -47,7 +47,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionOneStatementPerLineOne']]/OBJBLOCK" + + "/VARIABLE_DEF[./IDENT[@text='j']]/SEMI"); +@@ -56,7 +56,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOneStatementPerLineTwo.java")); + +@@ -67,7 +67,7 @@ public class XpathRegressionOneStatementPerLineTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionOneStatementPerLineTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='foo5']]/SLIST/LITERAL_FOR/SLIST/SEMI[2]"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneTopLevelClassTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneTopLevelClassTest.java +index df60d5fde..29db371fc 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneTopLevelClassTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOneTopLevelClassTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSupport { ++final class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSupport { + + private final String checkName = OneTopLevelClassCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSuppor + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOneTopLevelClassFirst.java")); + +@@ -58,7 +58,7 @@ public class XpathRegressionOneTopLevelClassTest extends AbstractXpathTestSuppor + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOneTopLevelClassSecond.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java +index 9a7e0538f..6f60b8977 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOperatorWrapTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { ++final class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + + private final String checkName = OperatorWrapCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOperatorWrapNewLine() throws Exception { ++ void operatorWrapNewLine() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOperatorWrapNewLine.java")); + +@@ -47,7 +47,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionOperatorWrapNewLine']]" +@@ -60,7 +60,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOperatorWrapPreviousLine() throws Exception { ++ void operatorWrapPreviousLine() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOperatorWrapPreviousLine.java")); + +@@ -73,7 +73,7 @@ public class XpathRegressionOperatorWrapTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionOperatorWrapPreviousLine']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='b']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeFilenameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeFilenameTest.java +index 9b5b23b74..7fdcfd44b 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeFilenameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeFilenameTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSupport { ++final class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSupport { + + private final String checkName = OuterTypeFilenameCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testNoPublic() throws Exception { ++ void noPublic() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOuterTypeFilename1.java")); + +@@ -56,7 +56,7 @@ public class XpathRegressionOuterTypeFilenameTest extends AbstractXpathTestSuppo + } + + @Test +- public void testNested() throws Exception { ++ void nested() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOuterTypeFilename2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeNumberTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeNumberTest.java +index ca6a87e1b..622d72e1a 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeNumberTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOuterTypeNumberTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport { ++final class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport { + + private final String checkName = OuterTypeNumberCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOuterTypeNumberDefault.java")); + +@@ -53,7 +53,7 @@ public class XpathRegressionOuterTypeNumberTest extends AbstractXpathTestSupport + } + + @Test +- public void testMax() throws Exception { ++ void max() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionOuterTypeNumber.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(OuterTypeNumberCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOverloadMethodsDeclarationOrderTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOverloadMethodsDeclarationOrderTest.java +index c9a1317ed..6b8e468e8 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOverloadMethodsDeclarationOrderTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionOverloadMethodsDeclarationOrderTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionOverloadMethodsDeclarationOrderTest extends AbstractXpathTestSupport { ++final class XpathRegressionOverloadMethodsDeclarationOrderTest extends AbstractXpathTestSupport { + + private final Class clazz = + OverloadMethodsDeclarationOrderCheck.class; +@@ -37,7 +37,7 @@ public class XpathRegressionOverloadMethodsDeclarationOrderTest extends Abstract + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder1.java")); + +@@ -64,7 +64,7 @@ public class XpathRegressionOverloadMethodsDeclarationOrderTest extends Abstract + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java +index c162d6e64..7babfec55 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageAnnotationTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSupport { ++final class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSupport { + + private final String checkName = PackageAnnotationCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSuppo + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionPackageAnnotationOne.java")); + +@@ -53,7 +53,7 @@ public class XpathRegressionPackageAnnotationTest extends AbstractXpathTestSuppo + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionPackageAnnotationTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java +index 586cc8c19..288279791 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPackageDeclarationTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupport { ++final class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupport { + + private final String checkName = PackageDeclarationCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupp + } + + @Test +- public void test1() throws Exception { ++ void test1() throws Exception { + final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); +@@ -54,7 +54,7 @@ public class XpathRegressionPackageDeclarationTest extends AbstractXpathTestSupp + } + + @Test +- public void test2() throws Exception { ++ void test2() throws Exception { + final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java +index 2da530d29..4d628bb9e 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionParenPadTest.java +@@ -19,16 +19,16 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck; + import com.puppycrawl.tools.checkstyle.checks.whitespace.PadOption; + import com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { ++final class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + + private final String checkName = ParenPadCheck.class.getSimpleName(); + +@@ -38,7 +38,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + } + + @Test +- public void testLeftFollowed() throws Exception { ++ void leftFollowed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionParenPadLeftFollowed.java")); + +@@ -49,7 +49,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionParenPadLeftFollowed']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/LPAREN"); +@@ -58,7 +58,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + } + + @Test +- public void testLeftNotFollowed() throws Exception { ++ void leftNotFollowed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionParenPadLeftNotFollowed.java")); + +@@ -71,7 +71,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionParenPadLeftNotFollowed']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/LPAREN"); +@@ -80,7 +80,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + } + + @Test +- public void testRightPreceded() throws Exception { ++ void rightPreceded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionParenPadRightPreceded.java")); + +@@ -91,7 +91,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionParenPadRightPreceded']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/RPAREN"); +@@ -100,7 +100,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + } + + @Test +- public void testRightNotPreceded() throws Exception { ++ void rightNotPreceded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionParenPadRightNotPreceded.java")); + +@@ -113,7 +113,7 @@ public class XpathRegressionParenPadTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionParenPadRightNotPreceded']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='method']]/SLIST/LITERAL_IF/RPAREN"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java +index 55a0d6443..123e20aa8 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionPatternVariableNameTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.PatternVariableNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSupport { + + private final String checkName = PatternVariableNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName1.java")); + +@@ -54,7 +54,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName1']]" + + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" +@@ -65,7 +65,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName2.java")); + +@@ -84,7 +84,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName2']]" + + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" +@@ -95,7 +95,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName3.java")); + +@@ -114,7 +114,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName3']]" + + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/" +@@ -125,7 +125,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionPatternVariableName4.java")); + +@@ -144,7 +144,7 @@ public class XpathRegressionPatternVariableNameTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionPatternVariableName1']]" + + "/OBJBLOCK/CTOR_DEF[./IDENT[@text='MyClass']]/SLIST/LITERAL_IF/EXPR/" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java +index 74c85bcaa..4a7aacc59 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNameTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.RecordComponentNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSupport { + + private final String checkName = RecordComponentNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRecordComponentName1.java")); + +@@ -53,7 +53,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/RECORD_DEF[./IDENT[@text='SuppressionXpathRecordComponentName1']]" + + "/RECORD_COMPONENTS/RECORD_COMPONENT_DEF/IDENT[@text='_value']"); + +@@ -61,7 +61,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRecordComponentName2.java")); + +@@ -78,7 +78,7 @@ public class XpathRegressionRecordComponentNameTest extends AbstractXpathTestSup + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRecordComponentName2']]/OBJBLOCK" + + "/RECORD_DEF[./IDENT[@text='MyRecord']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNumberTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNumberTest.java +index 641bffe51..ac37a3e97 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNumberTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordComponentNumberTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestSupport { ++final class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestSupport { + + private final String checkName = RecordComponentNumberCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestS + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRecordComponentNumber1.java")); + +@@ -60,7 +60,7 @@ public class XpathRegressionRecordComponentNumberTest extends AbstractXpathTestS + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRecordComponentNumber2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java +index bfce201c6..99dcb1fe1 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRecordTypeParameterNameTest.java +@@ -27,7 +27,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTestSupport { + + private final String checkName = RecordTypeParameterNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTes + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionRecordTypeParameterName1.java")); + +@@ -66,7 +66,7 @@ public class XpathRegressionRecordTypeParameterNameTest extends AbstractXpathTes + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getNonCompilablePath("SuppressionXpathRegressionRecordTypeParameterName2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java +index 33b13aa7c..fbdcf0b61 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRedundantImportTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.RedundantImportCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport { ++final class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport { + + private final String checkName = RedundantImportCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRedundantImport1.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(RedundantImportCheck.class); + final String[] expectedViolation = { +@@ -47,13 +47,13 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport + "org.checkstyle.suppressionxpathfilter" + + ".redundantimport.SuppressionXpathRegressionRedundantImport1"), + }; +- final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRedundantImport2.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(RedundantImportCheck.class); + final String[] expectedViolation = { +@@ -61,13 +61,13 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport + + getCheckMessage( + RedundantImportCheck.class, RedundantImportCheck.MSG_LANG, "java.lang.String"), + }; +- final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/IMPORT"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/IMPORT"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRedundantImport3.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(RedundantImportCheck.class); + final String[] expectedViolation = { +@@ -79,7 +79,7 @@ public class XpathRegressionRedundantImportTest extends AbstractXpathTestSupport + "java.util.Scanner"), + }; + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Scanner']]"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRequireThisTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRequireThisTest.java +index 53893ae61..d72f9e6d9 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRequireThisTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRequireThisTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { ++final class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { + + private final String checkName = RequireThisCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRequireThisOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(RequireThisCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionRequireThisOne']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='changeAge']]/SLIST/EXPR/ASSIGN" +@@ -57,7 +57,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRequireThisTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(RequireThisCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionRequireThisTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionRequireThisTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='method2']]/SLIST/EXPR" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.java +index 0d96b2255..b7c92de87 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionRightCurlyTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck; + import com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyOption; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { ++final class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + + private final String checkName = RightCurlyCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); +@@ -47,7 +47,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyOne']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='test']]/SLIST/LITERAL_IF/SLIST/RCURLY"); +@@ -56,7 +56,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyTwo']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='fooMethod']]/SLIST/LITERAL_TRY/SLIST/RCURLY"); +@@ -77,7 +77,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyThree.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); +@@ -89,7 +89,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyThree']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST/RCURLY"); +@@ -98,7 +98,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionRightCurlyFour.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(RightCurlyCheck.class); +@@ -111,7 +111,7 @@ public class XpathRegressionRightCurlyTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionRightCurlyFour']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='sample']]/SLIST/LITERAL_IF/SLIST/RCURLY"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java +index 70499e926..23a3560b6 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSimplifyBooleanReturnTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck.MSG_KEY; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestSupport { ++final class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestSupport { + + private static final Class CLASS = SimplifyBooleanReturnCheck.class; + private final String checkName = CLASS.getSimpleName(); +@@ -39,7 +39,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS + } + + @Test +- public void testIfBooleanEqualsBoolean() throws Exception { ++ void ifBooleanEqualsBoolean() throws Exception { + final File fileToProcess = + new File( + getPath("SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanEqualsBoolean.java")); +@@ -51,7 +51,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanEqualsBoolean']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='toTest']]/SLIST/LITERAL_IF"); +@@ -60,7 +60,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS + } + + @Test +- public void testIfBooleanReturnBoolean() throws Exception { ++ void ifBooleanReturnBoolean() throws Exception { + final File fileToProcess = + new File( + getPath("SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanReturnBoolean.java")); +@@ -72,7 +72,7 @@ public class XpathRegressionSimplifyBooleanReturnTest extends AbstractXpathTestS + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionSimplifyBooleanReturnIfBooleanReturnBoolean']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='toTest']]/SLIST/EXPR/METHOD_CALL/ELIST" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java +index 9d53900e7..54ce36466 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionSingleSpaceSeparatorTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSupport { ++final class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSupport { + + private final String checkName = SingleSpaceSeparatorCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu + } + + @Test +- public void testSingleSpaceSeparator() throws Exception { ++ void singleSpaceSeparator() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionSingleSpaceSeparator.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionSingleSpaceSeparator']]/OBJBLOCK" + + "/VARIABLE_DEF/IDENT[@text='bad']"); +@@ -57,7 +57,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu + } + + @Test +- public void testValidateComments() throws Exception { ++ void validateComments() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionSingleSpaceSeparatorValidateComments.java")); + +@@ -70,7 +70,7 @@ public class XpathRegressionSingleSpaceSeparatorTest extends AbstractXpathTestSu + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[." + + "/IDENT[@text='SuppressionXpathRegressionSingleSpaceSeparatorValidateComments']]" + + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java +index 6c2699404..cfc9b2323 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionStringLiteralEqualityTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestSupport { ++final class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestSupport { + + private final String checkName = StringLiteralEqualityCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionStringLiteralEquality.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionStringLiteralEquality1.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); +@@ -85,7 +85,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionStringLiteralEquality2.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(StringLiteralEqualityCheck.class); +@@ -95,7 +95,7 @@ public class XpathRegressionStringLiteralEqualityTest extends AbstractXpathTestS + StringLiteralEqualityCheck.class, StringLiteralEqualityCheck.MSG_KEY, "=="), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionStringLiteralEquality2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunction']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java +index 5c8a8516e..ddf5ddbbd 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionThrowsCountTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { ++final class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { + + private final String checkName = ThrowsCountCheck.class.getSimpleName(); + +@@ -36,14 +36,14 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionThrowsCount1.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); + final String[] expectedViolation = { + "4:30: " + getCheckMessage(ThrowsCountCheck.class, ThrowsCountCheck.MSG_KEY, 5, 4), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionThrowsCount1']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunction']]" +@@ -53,7 +53,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionThrowsCount2.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); + +@@ -63,7 +63,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { + "4:30: " + getCheckMessage(ThrowsCountCheck.class, ThrowsCountCheck.MSG_KEY, 3, 2), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/INTERFACE_DEF[./IDENT[@text='SuppressionXpathRegressionThrowsCount2']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunction']]" +@@ -73,7 +73,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionThrowsCount3.java")); + final DefaultConfiguration moduleConfig = createModuleConfig(ThrowsCountCheck.class); + +@@ -83,7 +83,7 @@ public class XpathRegressionThrowsCountTest extends AbstractXpathTestSupport { + "9:40: " + getCheckMessage(ThrowsCountCheck.class, ThrowsCountCheck.MSG_KEY, 5, 4), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text='SuppressionXpathRegressionThrowsCount3']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='myFunc']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java +index 732c830b6..471eb4666 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTodoCommentTest.java +@@ -21,14 +21,14 @@ package org.checkstyle.suppressionxpathfilter; + + import static com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck.MSG_KEY; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { ++final class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { + private final String checkName = TodoCommentCheck.class.getSimpleName(); + + @Override +@@ -37,7 +37,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionTodoCommentOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(TodoCommentCheck.class); +@@ -48,7 +48,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionTodoCommentOne']]/OBJBLOCK/" + + "SINGLE_LINE_COMMENT/COMMENT_CONTENT[@text=' warn FIXME:\\n']"); +@@ -57,7 +57,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionTodoCommentTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(TodoCommentCheck.class); +@@ -68,7 +68,7 @@ public class XpathRegressionTodoCommentTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionTodoCommentTwo']]/" + + "OBJBLOCK/BLOCK_COMMENT_BEGIN/COMMENT_CONTENT" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java +index 8fda5e32f..371db145e 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTrailingCommentTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport { ++final class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport { + private final String checkName = TrailingCommentCheck.class.getSimpleName(); + + @Override +@@ -35,7 +35,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionTrailingComment1.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(TrailingCommentCheck.class); +@@ -45,7 +45,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionTrailingComment1']]/" + + "OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' don'" +@@ -55,7 +55,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionTrailingComment2.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(TrailingCommentCheck.class); +@@ -65,7 +65,7 @@ public class XpathRegressionTrailingCommentTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionTrailingComment2']]" + + "/OBJBLOCK/SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' warn\\n']]"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java +index 2ccd2ab0f..fcc8b2c78 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypeNameTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { ++final class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { + + private final String checkName = TypeNameCheck.class.getSimpleName(); + +@@ -37,7 +37,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void test1() throws Exception { ++ void test1() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypeName1.java")); + + final String pattern = "^[A-Z][a-zA-Z0-9]*$"; +@@ -50,7 +50,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionTypeName1']]" +@@ -59,7 +59,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { + } + + @Test +- public void test2() throws Exception { ++ void test2() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionTypeName2.java")); + + final String pattern = "^I_[a-zA-Z0-9]*$"; +@@ -74,7 +74,7 @@ public class XpathRegressionTypeNameTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT" + + "/CLASS_DEF[./IDENT[@text" + + "='SuppressionXpathRegressionTypeName2']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java +index d5e1f9298..2601a11d7 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionTypecastParenPadTest.java +@@ -19,17 +19,17 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.AbstractParenPadCheck; + import com.puppycrawl.tools.checkstyle.checks.whitespace.PadOption; + import com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSupport { ++final class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSupport { + + private final String checkName = TypecastParenPadCheck.class.getSimpleName(); + +@@ -39,7 +39,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + } + + @Test +- public void testLeftFollowed() throws Exception { ++ void leftFollowed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionTypecastParenPadLeftFollowed.java")); + +@@ -64,7 +64,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + } + + @Test +- public void testLeftNotFollowed() throws Exception { ++ void leftNotFollowed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionTypecastParenPadLeftNotFollowed.java")); + +@@ -90,7 +90,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + } + + @Test +- public void testRightPreceded() throws Exception { ++ void rightPreceded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionTypecastParenPadRightPreceded.java")); + +@@ -103,7 +103,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionTypecastParenPadRightPreceded']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); +@@ -112,7 +112,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + } + + @Test +- public void testRightNotPreceded() throws Exception { ++ void rightNotPreceded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionTypecastParenPadRightNotPreceded.java")); + +@@ -126,7 +126,7 @@ public class XpathRegressionTypecastParenPadTest extends AbstractXpathTestSuppor + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionTypecastParenPadRightNotPreceded']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUncommentedMainTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUncommentedMainTest.java +index f944480dd..55149c329 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUncommentedMainTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUncommentedMainTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport { ++final class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport { + + private final Class clazz = UncommentedMainCheck.class; + +@@ -36,7 +36,7 @@ public class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionUncommentedMain.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(UncommentedMainCheck.class); +@@ -61,7 +61,7 @@ public class XpathRegressionUncommentedMainTest extends AbstractXpathTestSupport + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUncommentedMainTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.java +index d8eb94213..19147767c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessaryParenthesesTest.java +@@ -19,15 +19,15 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTestSupport { ++final class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTestSupport { + + @Override + protected String getCheckName() { +@@ -35,7 +35,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses1.java")); + +@@ -62,7 +62,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses2.java")); + +@@ -89,7 +89,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testThree() throws Exception { ++ void three() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses3.java")); + +@@ -102,7 +102,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses3']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='predicate']]" +@@ -112,7 +112,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testFour() throws Exception { ++ void four() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses4.java")); + +@@ -125,7 +125,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses4']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" +@@ -136,7 +136,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testFive() throws Exception { ++ void five() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses5.java")); + +@@ -151,7 +151,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses5']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" +@@ -162,7 +162,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testSix() throws Exception { ++ void six() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses6.java")); + +@@ -175,7 +175,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='SuppressionXpathRegressionUnnecessaryParentheses6']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='foo']]" +@@ -186,7 +186,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testSeven() throws Exception { ++ void seven() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses7.java")); + +@@ -213,7 +213,7 @@ public class XpathRegressionUnnecessaryParenthesesTest extends AbstractXpathTest + } + + @Test +- public void testEight() throws Exception { ++ void eight() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessaryParentheses8.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java +index c5e1942e3..9e82acfa8 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest ++final class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + extends AbstractXpathTestSupport { + + private static final Class CLASS = +@@ -38,7 +38,7 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File( + getPath( +@@ -48,13 +48,13 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + "5:2: " + getCheckMessage(CLASS, UnnecessarySemicolonAfterOuterTypeDeclarationCheck.MSG_SEMI), + }; + +- final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/SEMI"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/SEMI"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File( + getPath( +@@ -66,7 +66,7 @@ public class XpathRegressionUnnecessarySemicolonAfterOuterTypeDeclarationTest + + getCheckMessage(CLASS, UnnecessarySemicolonAfterOuterTypeDeclarationCheck.MSG_SEMI), + }; + +- final List expectedXpathQueries = Collections.singletonList("/COMPILATION_UNIT/SEMI"); ++ final List expectedXpathQueries = ImmutableList.of("/COMPILATION_UNIT/SEMI"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest.java +index 044e36431..13e9227dc 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterTypeMemberDeclarationCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest ++final class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + extends AbstractXpathTestSupport { + + private static final Class CLASS = +@@ -38,7 +38,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = + new File( + getPath( +@@ -50,7 +50,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT" + + "[@text=" + + "'SuppressionXpathRegressionUnnecessarySemicolonAfterTypeMemberDeclaration']]" +@@ -60,7 +60,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + } + + @Test +- public void testTokens() throws Exception { ++ void tokens() throws Exception { + final File fileToProcess = + new File( + getPath( +@@ -75,7 +75,7 @@ public class XpathRegressionUnnecessarySemicolonAfterTypeMemberDeclarationTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[." + + "/IDENT[@text='SuppressionXpathRegressionUnnecessarySemicolonAfterTypeMember" + + "DeclarationTokens']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java +index 044d20332..073d05b6c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInEnumerationTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonInEnumerationCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends AbstractXpathTestSupport { ++final class XpathRegressionUnnecessarySemicolonInEnumerationTest extends AbstractXpathTestSupport { + + private final String checkName = UnnecessarySemicolonInEnumerationCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInEnumeration.java")); + +@@ -51,13 +51,13 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra + }; + + final List expectedXpathQueries = +- Collections.singletonList("/COMPILATION_UNIT/ENUM_DEF[./IDENT[@text='Bad']]/OBJBLOCK/SEMI"); ++ ImmutableList.of("/COMPILATION_UNIT/ENUM_DEF[./IDENT[@text='Bad']]/OBJBLOCK/SEMI"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInEnumerationAll.java")); + +@@ -72,7 +72,7 @@ public class XpathRegressionUnnecessarySemicolonInEnumerationTest extends Abstra + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/ENUM_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionUnnecessarySemicolonInEnumerationAll']]" + + "/OBJBLOCK/SEMI"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java +index 6170dd0f9..cc10b77be 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnnecessarySemicolonInTryWithResourcesTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonInTryWithResourcesCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest ++final class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest + extends AbstractXpathTestSupport { + + private final String checkName = +@@ -38,7 +38,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnnecessarySemicolonInTryWithResources.java")); + final DefaultConfiguration moduleConfig = +@@ -54,7 +54,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest + UnnecessarySemicolonInTryWithResourcesCheck.MSG_SEMI), + }; + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionUnnecessarySemicolonInTryWithResources']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='m']]/SLIST/LITERAL_TRY" +@@ -63,7 +63,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest + } + + @Test +- public void testAllowWhenNoBraceAfterSemicolon() throws Exception { ++ void allowWhenNoBraceAfterSemicolon() throws Exception { + final File fileToProcess = + new File( + getPath( +@@ -81,7 +81,7 @@ public class XpathRegressionUnnecessarySemicolonInTryWithResourcesTest + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text=" + + "'SuppressionXpathRegressionUnnecessarySemicolonInTryWithResourcesNoBrace']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='test']]" +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java +index e5d2c408c..ad52d8b1f 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedImportsTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { ++final class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { + + private final String checkName = UnusedImportsCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedImportsOne.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(UnusedImportsCheck.class); +@@ -47,14 +47,14 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/IMPORT/DOT[./IDENT[@text='List']]/DOT/IDENT[@text='java']"); + + runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionUnusedImportsTwo.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(UnusedImportsCheck.class); +@@ -66,7 +66,7 @@ public class XpathRegressionUnusedImportsTest extends AbstractXpathTestSupport { + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/STATIC_IMPORT/DOT" + + "[./IDENT[@text='Entry']]/DOT[./IDENT[@text='Map']]" + + "/DOT/IDENT[@text='java']"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLocalVariableTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLocalVariableTest.java +index 09ddf0eb3..240a31f5e 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLocalVariableTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUnusedLocalVariableTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSupport { ++final class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSupport { + private final String checkName = UnusedLocalVariableCheck.class.getSimpleName(); + + @Override +@@ -35,7 +35,7 @@ public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSup + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnusedLocalVariableOne.java")); + +@@ -71,7 +71,7 @@ public class XpathRegressionUnusedLocalVariableTest extends AbstractXpathTestSup + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionUnusedLocalVariableTwo.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUpperEllTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUpperEllTest.java +index 60c190fcc..eae16ae3c 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUpperEllTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionUpperEllTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { ++final class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { + + private final String checkName = UpperEllCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { + } + + @Test +- public void testUpperEllOne() throws Exception { ++ void upperEllOne() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionUpperEllFirst.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(UpperEllCheck.class); +@@ -59,7 +59,7 @@ public class XpathRegressionUpperEllTest extends AbstractXpathTestSupport { + } + + @Test +- public void testUpperEllTwo() throws Exception { ++ void upperEllTwo() throws Exception { + final File fileToProcess = new File(getPath("SuppressionXpathRegressionUpperEllSecond.java")); + + final DefaultConfiguration moduleConfig = createModuleConfig(UpperEllCheck.class); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVariableDeclarationUsageDistanceTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVariableDeclarationUsageDistanceTest.java +index 84c19a542..19e810e71 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVariableDeclarationUsageDistanceTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionVariableDeclarationUsageDistanceTest.java +@@ -26,7 +26,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionVariableDeclarationUsageDistanceTest extends AbstractXpathTestSupport { ++final class XpathRegressionVariableDeclarationUsageDistanceTest extends AbstractXpathTestSupport { + private final String checkName = VariableDeclarationUsageDistanceCheck.class.getSimpleName(); + + @Override +@@ -35,7 +35,7 @@ public class XpathRegressionVariableDeclarationUsageDistanceTest extends Abstrac + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionVariableDeclarationUsageDistance1.java")); + +@@ -79,7 +79,7 @@ public class XpathRegressionVariableDeclarationUsageDistanceTest extends Abstrac + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionVariableDeclarationUsageDistance2.java")); + +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java +index 019f8bbcb..73b8840b7 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAfterTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport { ++final class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport { + + private final String checkName = WhitespaceAfterCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport + } + + @Test +- public void testWhitespaceAfterTypecast() throws Exception { ++ void whitespaceAfterTypecast() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionWhitespaceAfterTypecast.java")); + +@@ -48,7 +48,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionWhitespaceAfterTypecast']]/OBJBLOCK" + + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/EXPR/TYPECAST/RPAREN"); +@@ -57,7 +57,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport + } + + @Test +- public void testWhitespaceAfterNotFollowed() throws Exception { ++ void whitespaceAfterNotFollowed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionWhitespaceAfterNotFollowed.java")); + +@@ -70,7 +70,7 @@ public class XpathRegressionWhitespaceAfterTest extends AbstractXpathTestSupport + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionWhitespaceAfterNotFollowed']]/OBJBLOCK" + + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN/ARRAY_INIT/COMMA"); +diff --git a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java +index e7f55f123..f4baa188f 100644 +--- a/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java ++++ b/src/it/java/org/checkstyle/suppressionxpathfilter/XpathRegressionWhitespaceAroundTest.java +@@ -19,14 +19,14 @@ + + package org.checkstyle.suppressionxpathfilter; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck; + import java.io.File; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSupport { ++final class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSupport { + + private final String checkName = WhitespaceAroundCheck.class.getSimpleName(); + +@@ -36,7 +36,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor + } + + @Test +- public void testWhitespaceAroundNotPreceded() throws Exception { ++ void whitespaceAroundNotPreceded() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionWhitespaceAroundNotPreceded.java")); + +@@ -49,7 +49,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionWhitespaceAroundNotPreceded']]/OBJBLOCK" + + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN"); +@@ -58,7 +58,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor + } + + @Test +- public void testWhitespaceAroundNotFollowed() throws Exception { ++ void whitespaceAroundNotFollowed() throws Exception { + final File fileToProcess = + new File(getPath("SuppressionXpathRegressionWhitespaceAroundNotFollowed.java")); + +@@ -71,7 +71,7 @@ public class XpathRegressionWhitespaceAroundTest extends AbstractXpathTestSuppor + }; + + final List expectedXpathQueries = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[" + + "@text='SuppressionXpathRegressionWhitespaceAroundNotFollowed']]/OBJBLOCK" + + "/VARIABLE_DEF[./IDENT[@text='bad']]/ASSIGN"); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java b/src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java +index 22ac6386b..f9288a508 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBean.java +@@ -275,8 +275,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali + /** A converter that converts a string to a pattern. */ + private static final class PatternConverter implements Converter { + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Object convert(Class type, Object value) { + return CommonUtil.createPattern(value.toString()); + } +@@ -285,8 +285,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali + /** A converter that converts strings to severity level. */ + private static final class SeverityLevelConverter implements Converter { + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Object convert(Class type, Object value) { + return SeverityLevel.getInstance(value.toString()); + } +@@ -295,8 +295,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali + /** A converter that converts strings to scope. */ + private static final class ScopeConverter implements Converter { + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Object convert(Class type, Object value) { + return Scope.getInstance(value.toString()); + } +@@ -305,8 +305,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali + /** A converter that converts strings to uri. */ + private static final class UriConverter implements Converter { + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Object convert(Class type, Object value) { + final String url = value.toString(); + URI result = null; +@@ -329,8 +329,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali + */ + private static final class RelaxedStringArrayConverter implements Converter { + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Object convert(Class type, Object value) { + final StringTokenizer tokenizer = + new StringTokenizer(value.toString().trim(), COMMA_SEPARATOR); +@@ -355,8 +355,8 @@ public abstract class AbstractAutomaticBean implements Configurable, Contextuali + /** Constant for optimization. */ + private static final AccessModifierOption[] EMPTY_MODIFIER_ARRAY = new AccessModifierOption[0]; + +- @SuppressWarnings("unchecked") + @Override ++ @SuppressWarnings("unchecked") + public Object convert(Class type, Object value) { + // Converts to a String and trims it for the tokenizer. + final StringTokenizer tokenizer = +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java b/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java +index a5b7a4235..711df6a27 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/Checker.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++import static com.google.common.collect.ImmutableSet.toImmutableSet; ++ + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.AuditListener; + import com.puppycrawl.tools.checkstyle.api.BeforeExecutionFileFilter; +@@ -50,7 +53,6 @@ import java.util.Locale; + import java.util.Set; + import java.util.SortedSet; + import java.util.TreeSet; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; +@@ -211,7 +213,7 @@ public class Checker extends AbstractAutomaticBean implements MessageDispatcher, + final List targetFiles = + files.stream() + .filter(file -> CommonUtil.matchesFileExtension(file, fileExtensions)) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + processFiles(targetFiles); + + // Finish up +@@ -238,7 +240,7 @@ public class Checker extends AbstractAutomaticBean implements MessageDispatcher, + .filter(ExternalResourceHolder.class::isInstance) + .map(ExternalResourceHolder.class::cast) + .flatMap(resource -> resource.getExternalResourceLocations().stream()) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + + /** Notify all listeners about the audit start. */ +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java +index 665d53658..389250fab 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/ConfigurationLoader.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkState; ++ + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.api.SeverityLevel; +@@ -514,9 +516,7 @@ public final class ConfigurationLoader { + final DefaultConfiguration top = configStack.peek(); + top.addMessage(key, value); + } else { +- if (!METADATA.equals(qName)) { +- throw new IllegalStateException("Unknown name:" + qName + "."); +- } ++ checkState(METADATA.equals(qName), "Unknown name:%s.", qName); + } + } + +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java b/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java +index 5839a4b3a..10c7c4ecc 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/DefaultLogger.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static java.nio.charset.StandardCharsets.UTF_8; ++ + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.AuditListener; + import com.puppycrawl.tools.checkstyle.api.AutomaticBean; +@@ -27,7 +30,6 @@ import java.io.OutputStream; + import java.io.OutputStreamWriter; + import java.io.PrintWriter; + import java.io.Writer; +-import java.nio.charset.StandardCharsets; + + /** + * Simple plain logger for text output. This is maybe not very suitable for a text output into a +@@ -122,21 +124,17 @@ public class DefaultLogger extends AbstractAutomaticBean implements AuditListene + OutputStream errorStream, + OutputStreamOptions errorStreamOptions, + AuditEventFormatter messageFormatter) { +- if (infoStreamOptions == null) { +- throw new IllegalArgumentException("Parameter infoStreamOptions can not be null"); +- } ++ checkArgument(infoStreamOptions != null, "Parameter infoStreamOptions can not be null"); + closeInfo = infoStreamOptions == OutputStreamOptions.CLOSE; +- if (errorStreamOptions == null) { +- throw new IllegalArgumentException("Parameter errorStreamOptions can not be null"); +- } ++ checkArgument(errorStreamOptions != null, "Parameter errorStreamOptions can not be null"); + closeError = errorStreamOptions == OutputStreamOptions.CLOSE; +- final Writer infoStreamWriter = new OutputStreamWriter(infoStream, StandardCharsets.UTF_8); ++ final Writer infoStreamWriter = new OutputStreamWriter(infoStream, UTF_8); + infoWriter = new PrintWriter(infoStreamWriter); + + if (infoStream == errorStream) { + errorWriter = infoWriter; + } else { +- final Writer errorStreamWriter = new OutputStreamWriter(errorStream, StandardCharsets.UTF_8); ++ final Writer errorStreamWriter = new OutputStreamWriter(errorStream, UTF_8); + errorWriter = new PrintWriter(errorStreamWriter); + } + formatter = messageFormatter; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java b/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java +index fe075370f..13c06f624 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/Definitions.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle; + ++import com.google.common.collect.ImmutableSet; + import java.util.Set; + + /** Contains constant definitions common to the package. */ +@@ -29,7 +30,7 @@ public final class Definitions { + + /** Name of modules which are not checks, but are internal modules. */ + public static final Set INTERNAL_MODULES = +- Set.of("com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper"); ++ ImmutableSet.of("com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper"); + + /** Do no allow {@code Definitions} instances to be created. */ + private Definitions() {} +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/DetailAstImpl.java b/src/main/java/com/puppycrawl/tools/checkstyle/DetailAstImpl.java +index cacf5cd33..71621f70b 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/DetailAstImpl.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/DetailAstImpl.java +@@ -19,10 +19,11 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.util.Collections.unmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.BitSet; +-import java.util.Collections; + import java.util.List; + import org.antlr.v4.runtime.Token; + +@@ -495,7 +496,7 @@ public final class DetailAstImpl implements DetailAST { + public List getHiddenBefore() { + List returnList = null; + if (hiddenBefore != null) { +- returnList = Collections.unmodifiableList(hiddenBefore); ++ returnList = unmodifiableList(hiddenBefore); + } + return returnList; + } +@@ -509,7 +510,7 @@ public final class DetailAstImpl implements DetailAST { + public List getHiddenAfter() { + List returnList = null; + if (hiddenAfter != null) { +- returnList = Collections.unmodifiableList(hiddenAfter); ++ returnList = unmodifiableList(hiddenAfter); + } + return returnList; + } +@@ -520,7 +521,7 @@ public final class DetailAstImpl implements DetailAST { + * @param hiddenBefore comment token preceding this DetailAstImpl + */ + public void setHiddenBefore(List hiddenBefore) { +- this.hiddenBefore = Collections.unmodifiableList(hiddenBefore); ++ this.hiddenBefore = unmodifiableList(hiddenBefore); + } + + /** +@@ -529,6 +530,6 @@ public final class DetailAstImpl implements DetailAST { + * @param hiddenAfter comment token following this DetailAstImpl + */ + public void setHiddenAfter(List hiddenAfter) { +- this.hiddenAfter = Collections.unmodifiableList(hiddenAfter); ++ this.hiddenAfter = unmodifiableList(hiddenAfter); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java b/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java +index a40c5e7d9..3996bd6b9 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/JavaAstVisitor.java +@@ -19,19 +19,21 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.Objects.requireNonNullElseGet; ++import static java.util.stream.Collectors.toCollection; ++ ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageLexer; + import com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageParser; + import com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageParserBaseVisitor; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.Iterator; + import java.util.List; +-import java.util.Optional; + import java.util.Queue; + import java.util.concurrent.ConcurrentLinkedQueue; +-import java.util.stream.Collectors; + import org.antlr.v4.runtime.BufferedTokenStream; + import org.antlr.v4.runtime.CommonTokenStream; + import org.antlr.v4.runtime.ParserRuleContext; +@@ -406,7 +408,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) +- .collect(Collectors.toList())); ++ .collect(toImmutableList())); + + // We add C style array declarator brackets to TYPE ast + final DetailAstImpl typeAst = (DetailAstImpl) methodDef.findFirstToken(TokenTypes.TYPE); +@@ -469,7 +471,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor children = + ctx.children.stream() + .filter(child -> !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + processChildren(methodDef, children); + + // We add C style array declarator brackets to TYPE ast +@@ -780,7 +782,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.ArrayDeclaratorContext)) +- .collect(Collectors.toList())); ++ .collect(toImmutableList())); + + // We add C style array declarator brackets to TYPE ast + final DetailAstImpl typeAst = +@@ -852,7 +854,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !child.equals(ctx.LITERAL_SUPER())) +- .collect(Collectors.toList())); ++ .collect(toImmutableList())); + return primaryCtorCall; + } + +@@ -1090,7 +1092,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !(child instanceof JavaLanguageParser.VariableModifierContext)) +- .collect(Collectors.toList())); ++ .collect(toImmutableList())); + return catchParameterDef; + } + +@@ -1412,8 +1414,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); ++ requireNonNullElseGet(visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); + + DetailAstPair.addAstChild(currentAst, expressionList); + DetailAstPair.addAstChild(currentAst, create(ctx.RPAREN())); +@@ -1439,8 +1440,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); ++ requireNonNullElseGet(visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); + + methodCall.addChild(expressionList); + methodCall.addChild(create((Token) ctx.RPAREN().getPayload())); +@@ -1499,7 +1499,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor children = + ctx.children.stream() + .filter(child -> !child.equals(ctx.DOUBLE_COLON())) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + processChildren(doubleColon, children); + return doubleColon; + } +@@ -1511,7 +1511,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor !child.equals(ctx.QUESTION())) +- .collect(Collectors.toList())); ++ .collect(toImmutableList())); + return root; + } + +@@ -1538,7 +1538,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor descendantList = + binOpList.parallelStream() + .map(this::getInnerBopAst) +- .collect(Collectors.toCollection(ConcurrentLinkedQueue::new)); ++ .collect(toCollection(ConcurrentLinkedQueue::new)); + + bop.addChild(descendantList.poll()); + DetailAstImpl pointer = bop.getFirstChild(); +@@ -1575,8 +1575,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); ++ requireNonNullElseGet(visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); + + final DetailAstImpl dot = create(ctx.DOT()); + dot.addChild(visit(ctx.expr())); +@@ -1609,8 +1608,8 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.PARAMETERS)); ++ requireNonNullElseGet( ++ visit(ctx.formalParameterList()), () -> createImaginary(TokenTypes.PARAMETERS)); + addLastSibling(lparen, parameters); + addLastSibling(lparen, create(ctx.RPAREN())); + return lparen; +@@ -1873,8 +1872,8 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); ++ requireNonNullElseGet( ++ visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); + root.addChild(expressionList); + + root.addChild(create(ctx.RPAREN())); +@@ -1889,8 +1888,7 @@ public final class JavaAstVisitor extends JavaLanguageParserBaseVisitor createImaginary(TokenTypes.ELIST)); ++ requireNonNullElseGet(visit(ctx.expressionList()), () -> createImaginary(TokenTypes.ELIST)); + addLastSibling(lparen, expressionList); + addLastSibling(lparen, create(ctx.RPAREN())); + return lparen; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGenerator.java b/src/main/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGenerator.java +index fb0887966..24a2c9559 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGenerator.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGenerator.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.nio.charset.StandardCharsets.UTF_8; ++ + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.DetailNode; +@@ -28,7 +30,6 @@ import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; + import java.io.File; + import java.io.IOException; + import java.io.PrintWriter; +-import java.nio.charset.StandardCharsets; + import java.util.function.Consumer; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +@@ -95,7 +96,7 @@ public final class JavadocPropertiesGenerator { + * @throws CheckstyleException if a javadoc comment can not be parsed + */ + private static void writePropertiesFile(CliOptions options) throws CheckstyleException { +- try (PrintWriter writer = new PrintWriter(options.outputFile, StandardCharsets.UTF_8)) { ++ try (PrintWriter writer = new PrintWriter(options.outputFile, UTF_8)) { + final DetailAST top = + JavaParser.parseFile(options.inputFile, JavaParser.Options.WITH_COMMENTS).getFirstChild(); + final DetailAST objBlock = getClassBody(top); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/LocalizedMessage.java b/src/main/java/com/puppycrawl/tools/checkstyle/LocalizedMessage.java +index 30862545c..28dd5fdc8 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/LocalizedMessage.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/LocalizedMessage.java +@@ -19,12 +19,13 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.nio.charset.StandardCharsets.UTF_8; ++ + import java.io.IOException; + import java.io.InputStreamReader; + import java.io.Reader; + import java.net.URL; + import java.net.URLConnection; +-import java.nio.charset.StandardCharsets; + import java.text.MessageFormat; + import java.util.Arrays; + import java.util.Locale; +@@ -147,8 +148,7 @@ public class LocalizedMessage { + final URLConnection connection = url.openConnection(); + if (connection != null) { + connection.setUseCaches(!reload); +- try (Reader streamReader = +- new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8)) { ++ try (Reader streamReader = new InputStreamReader(connection.getInputStream(), UTF_8)) { + // Only this line is changed to make it read property files as UTF-8. + resourceBundle = new PropertyResourceBundle(streamReader); + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/Main.java b/src/main/java/com/puppycrawl/tools/checkstyle/Main.java +index f0f11262e..108b8ebef 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/Main.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/Main.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.util.stream.Collectors.toCollection; ++ + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.AuditListener; +@@ -38,7 +40,6 @@ import java.util.ArrayList; + import java.util.LinkedList; + import java.util.List; + import java.util.Locale; +-import java.util.Objects; + import java.util.Properties; + import java.util.logging.ConsoleHandler; + import java.util.logging.Filter; +@@ -46,7 +47,6 @@ import java.util.logging.Level; + import java.util.logging.LogRecord; + import java.util.logging.Logger; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + import picocli.CommandLine; +@@ -272,7 +272,7 @@ public final class Main { + final String stringAst = + AstTreeStringPrinter.printFileAst(file, JavaParser.Options.WITHOUT_COMMENTS); + System.out.print(stringAst); +- } else if (Objects.nonNull(options.xpath)) { ++ } else if (options.xpath != null) { + final String branch = XpathUtil.printXpathBranch(options.xpath, filesToProcess.get(0)); + System.out.print(branch); + } else if (options.printAstWithComments) { +@@ -659,7 +659,7 @@ public final class Main { + * @noinspectionreason CanBeFinal - we use picocli, and it uses reflection to manage such fields + */ + @Option( +- names = {"-w", "--tabWidth"}, ++ names = {"--tabWidth", "-w"}, + description = + "Sets the length of the tab character. " + + "Used only with -s option. Default value is ${DEFAULT-VALUE}.") +@@ -667,7 +667,7 @@ public final class Main { + + /** Switch whether to generate suppressions file or not. */ + @Option( +- names = {"-g", "--generate-xpath-suppression"}, ++ names = {"--generate-xpath-suppression", "-g"}, + description = + "Generates to output a suppression xml to use to suppress all " + + "violations from user's config. Instead of printing every violation, " +@@ -692,7 +692,7 @@ public final class Main { + + /** Option that controls whether to print the AST of the file. */ + @Option( +- names = {"-t", "--tree"}, ++ names = {"--tree", "-t"}, + description = + "Prints Abstract Syntax Tree(AST) of the checked file. The option " + + "cannot be used other options and requires exactly one file to run on " +@@ -701,7 +701,7 @@ public final class Main { + + /** Option that controls whether to print the AST of the file including comments. */ + @Option( +- names = {"-T", "--treeWithComments"}, ++ names = {"--treeWithComments", "-T"}, + description = + "Prints Abstract Syntax Tree(AST) with comment nodes " + + "of the checked file. The option cannot be used with other options " +@@ -710,7 +710,7 @@ public final class Main { + + /** Option that controls whether to print the parse tree of the javadoc comment. */ + @Option( +- names = {"-j", "--javadocTree"}, ++ names = {"--javadocTree", "-j"}, + description = + "Prints Parse Tree of the Javadoc comment. " + + "The file have to contain only Javadoc comment content without " +@@ -721,7 +721,7 @@ public final class Main { + + /** Option that controls whether to print the full AST of the file. */ + @Option( +- names = {"-J", "--treeWithJavadoc"}, ++ names = {"--treeWithJavadoc", "-J"}, + description = + "Prints Abstract Syntax Tree(AST) with Javadoc nodes " + + "and comment nodes of the checked file. Attention that line number and " +@@ -733,7 +733,7 @@ public final class Main { + + /** Option that controls whether to print debug info. */ + @Option( +- names = {"-d", "--debug"}, ++ names = {"--debug", "-d"}, + description = "Prints all debug logging of CheckStyle utility.") + private boolean debug; + +@@ -744,7 +744,7 @@ public final class Main { + * @noinspectionreason CanBeFinal - we use picocli, and it uses reflection to manage such fields + */ + @Option( +- names = {"-e", "--exclude"}, ++ names = {"--exclude", "-e"}, + description = + "Directory/file to exclude from CheckStyle. The path can be the " + + "full, absolute path, or relative to the current path. Multiple " +@@ -758,7 +758,7 @@ public final class Main { + * @noinspectionreason CanBeFinal - we use picocli, and it uses reflection to manage such fields + */ + @Option( +- names = {"-x", "--exclude-regexp"}, ++ names = {"--exclude-regexp", "-x"}, + description = + "Directory/file pattern to exclude from CheckStyle. Multiple " + + "excludes are allowed.") +@@ -766,13 +766,13 @@ public final class Main { + + /** Switch whether to execute ignored modules or not. */ + @Option( +- names = {"-E", "--executeIgnoredModules"}, ++ names = {"--executeIgnoredModules", "-E"}, + description = "Allows ignored modules to be run.") + private boolean executeIgnoredModules; + + /** Show AST branches that match xpath. */ + @Option( +- names = {"-b", "--branch-matching-xpath"}, ++ names = {"--branch-matching-xpath", "-b"}, + description = "Shows Abstract Syntax Tree(AST) branches that match given XPath query.") + private String xpath; + +@@ -787,7 +787,7 @@ public final class Main { + .map(File::getAbsolutePath) + .map(Pattern::quote) + .map(pattern -> Pattern.compile("^" + pattern + "$")) +- .collect(Collectors.toCollection(ArrayList::new)); ++ .collect(toCollection(ArrayList::new)); + result.addAll(excludeRegex); + return result; + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLogger.java b/src/main/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLogger.java +index 5cb4dd0a9..b2c858cfc 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLogger.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLogger.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.nio.charset.StandardCharsets.UTF_8; ++ + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.AuditListener; + import com.puppycrawl.tools.checkstyle.api.SeverityLevel; +@@ -26,7 +28,6 @@ import java.io.OutputStream; + import java.io.OutputStreamWriter; + import java.io.PrintWriter; + import java.io.Writer; +-import java.nio.charset.StandardCharsets; + + /** Simple logger for metadata generator util. */ + public class MetadataGeneratorLogger extends AbstractAutomaticBean implements AuditListener { +@@ -48,7 +49,7 @@ public class MetadataGeneratorLogger extends AbstractAutomaticBean implements Au + */ + public MetadataGeneratorLogger( + OutputStream outputStream, OutputStreamOptions outputStreamOptions) { +- final Writer errorStreamWriter = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8); ++ final Writer errorStreamWriter = new OutputStreamWriter(outputStream, UTF_8); + errorWriter = new PrintWriter(errorStreamWriter); + formatter = new AuditEventDefaultFormatter(); + closeErrorWriter = outputStreamOptions == OutputStreamOptions.CLOSE; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java b/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java +index 81ff00c98..78c38197a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/PackageNamesLoader.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.util.Collections.unmodifiableSet; ++ + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.BufferedInputStream; +@@ -26,7 +28,6 @@ import java.io.IOException; + import java.io.InputStream; + import java.net.URL; + import java.util.ArrayDeque; +-import java.util.Collections; + import java.util.Deque; + import java.util.Enumeration; + import java.util.HashMap; +@@ -138,7 +139,7 @@ public final class PackageNamesLoader extends XmlLoader { + throw new CheckstyleException("unable to open one of package files", ex); + } + +- return Collections.unmodifiableSet(result); ++ return unmodifiableSet(result); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java b/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java +index 3a5f91f9f..73076a501 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/PackageObjectFactory.java +@@ -19,10 +19,18 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.stream.Collectors.groupingBy; ++import static java.util.stream.Collectors.joining; ++import static java.util.stream.Collectors.mapping; ++import static java.util.stream.Collectors.toCollection; ++ ++import com.google.common.collect.ImmutableMap; ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.utils.ModuleReflectionUtil; + import java.io.IOException; +-import java.util.Collections; + import java.util.HashMap; + import java.util.HashSet; + import java.util.LinkedHashSet; +@@ -30,7 +38,6 @@ import java.util.List; + import java.util.Map; + import java.util.Map.Entry; + import java.util.Set; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + + /** +@@ -125,12 +132,8 @@ public class PackageObjectFactory implements ModuleFactory { + */ + public PackageObjectFactory( + Set packageNames, ClassLoader moduleClassLoader, ModuleLoadOption moduleLoadOption) { +- if (moduleClassLoader == null) { +- throw new IllegalArgumentException(NULL_LOADER_MESSAGE); +- } +- if (packageNames.contains(null)) { +- throw new IllegalArgumentException(NULL_PACKAGE_MESSAGE); +- } ++ checkArgument(moduleClassLoader != null, NULL_LOADER_MESSAGE); ++ checkArgument(!packageNames.contains(null), NULL_PACKAGE_MESSAGE); + + // create a copy of the given set, but retain ordering + packages = new LinkedHashSet<>(packageNames); +@@ -146,14 +149,10 @@ public class PackageObjectFactory implements ModuleFactory { + * @throws IllegalArgumentException if moduleClassLoader is null or packageNames is null + */ + public PackageObjectFactory(String packageName, ClassLoader moduleClassLoader) { +- if (moduleClassLoader == null) { +- throw new IllegalArgumentException(NULL_LOADER_MESSAGE); +- } +- if (packageName == null) { +- throw new IllegalArgumentException(NULL_PACKAGE_MESSAGE); +- } ++ checkArgument(moduleClassLoader != null, NULL_LOADER_MESSAGE); ++ checkArgument(packageName != null, NULL_PACKAGE_MESSAGE); + +- packages = Collections.singleton(packageName); ++ packages = ImmutableSet.of(packageName); + this.moduleClassLoader = moduleClassLoader; + } + +@@ -272,7 +271,7 @@ public class PackageObjectFactory implements ModuleFactory { + returnValue = createObject(fullModuleNames.iterator().next()); + } else { + final String optionalNames = +- fullModuleNames.stream().sorted().collect(Collectors.joining(STRING_SEPARATOR)); ++ fullModuleNames.stream().sorted().collect(joining(STRING_SEPARATOR)); + final LocalizedMessage exceptionMessage = + new LocalizedMessage( + Definitions.CHECKSTYLE_BUNDLE, +@@ -299,12 +298,11 @@ public class PackageObjectFactory implements ModuleFactory { + returnValue = + ModuleReflectionUtil.getCheckstyleModules(packages, loader).stream() + .collect( +- Collectors.groupingBy( ++ groupingBy( + Class::getSimpleName, +- Collectors.mapping( +- Class::getCanonicalName, Collectors.toCollection(HashSet::new)))); ++ mapping(Class::getCanonicalName, toCollection(HashSet::new)))); + } catch (IOException ignore) { +- returnValue = Collections.emptyMap(); ++ returnValue = ImmutableMap.of(); + } + return returnValue; + } +@@ -318,8 +316,8 @@ public class PackageObjectFactory implements ModuleFactory { + public static String getShortFromFullModuleNames(String fullName) { + return NAME_TO_FULL_MODULE_NAME.entrySet().stream() + .filter(entry -> entry.getValue().equals(fullName)) +- .map(Entry::getKey) + .findFirst() ++ .map(Entry::getKey) + .orElse(fullName); + } + +@@ -333,7 +331,7 @@ public class PackageObjectFactory implements ModuleFactory { + private static String joinPackageNamesWithClassName(String className, Set packages) { + return packages.stream() + .collect( +- Collectors.joining( ++ joining( + PACKAGE_SEPARATOR + className + STRING_SEPARATOR, + "", + PACKAGE_SEPARATOR + className)); +@@ -381,7 +379,7 @@ public class PackageObjectFactory implements ModuleFactory { + packages.stream() + .map(packageName -> packageName + PACKAGE_SEPARATOR + name) + .flatMap(className -> Stream.of(className, className + CHECK_SUFFIX)) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + Object instance = null; + for (String possibleName : possibleNames) { + instance = createObject(possibleName); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java b/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java +index fa0da58d6..8d02e854a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/PropertiesExpander.java +@@ -19,10 +19,11 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkArgument; ++ ++import com.google.common.collect.Maps; + import java.util.Map; + import java.util.Properties; +-import java.util.function.Function; +-import java.util.stream.Collectors; + + /** Resolves external properties from an underlying {@code Properties} object. */ + public final class PropertiesExpander implements PropertyResolver { +@@ -37,12 +38,8 @@ public final class PropertiesExpander implements PropertyResolver { + * @throws IllegalArgumentException when properties argument is null + */ + public PropertiesExpander(Properties properties) { +- if (properties == null) { +- throw new IllegalArgumentException("cannot pass null"); +- } +- values = +- properties.stringPropertyNames().stream() +- .collect(Collectors.toMap(Function.identity(), properties::getProperty)); ++ checkArgument(properties != null, "cannot pass null"); ++ values = Maps.toMap(properties.stringPropertyNames(), properties::getProperty); + } + + @Override +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java b/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java +index e83aa2d4f..fe2856a9e 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/PropertyCacheFile.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +@@ -93,12 +95,8 @@ public final class PropertyCacheFile { + * @throws IllegalArgumentException when either arguments are null + */ + public PropertyCacheFile(Configuration config, String fileName) { +- if (config == null) { +- throw new IllegalArgumentException("config can not be null"); +- } +- if (fileName == null) { +- throw new IllegalArgumentException("fileName can not be null"); +- } ++ checkArgument(config != null, "config can not be null"); ++ checkArgument(fileName != null, "fileName can not be null"); + this.config = config; + this.fileName = fileName; + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java b/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java +index 478c2473b..c3022c248 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/SarifLogger.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static java.nio.charset.StandardCharsets.UTF_8; ++ + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.AuditListener; + import com.puppycrawl.tools.checkstyle.api.SeverityLevel; +@@ -29,7 +32,6 @@ import java.io.OutputStream; + import java.io.OutputStreamWriter; + import java.io.PrintWriter; + import java.io.StringWriter; +-import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.List; + import java.util.Locale; +@@ -107,10 +109,8 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener + */ + public SarifLogger(OutputStream outputStream, OutputStreamOptions outputStreamOptions) + throws IOException { +- if (outputStreamOptions == null) { +- throw new IllegalArgumentException("Parameter outputStreamOptions can not be null"); +- } +- writer = new PrintWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)); ++ checkArgument(outputStreamOptions != null, "Parameter outputStreamOptions can not be null"); ++ writer = new PrintWriter(new OutputStreamWriter(outputStream, UTF_8)); + closeStream = outputStreamOptions == OutputStreamOptions.CLOSE; + report = readResource("/com/puppycrawl/tools/checkstyle/sarif/SarifReport.template"); + resultLineColumn = +@@ -136,7 +136,7 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener + final String version = SarifLogger.class.getPackage().getImplementationVersion(); + final String rendered = + report +- .replace(VERSION_PLACEHOLDER, String.valueOf(version)) ++ .replace(VERSION_PLACEHOLDER, version) + .replace(RESULTS_PLACEHOLDER, String.join(",\n", results)); + writer.print(rendered); + if (closeStream) { +@@ -304,7 +304,7 @@ public class SarifLogger extends AbstractAutomaticBean implements AuditListener + result.write(buffer, 0, length); + length = inputStream.read(buffer); + } +- return result.toString(StandardCharsets.UTF_8); ++ return result.toString(UTF_8); + } + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinter.java b/src/main/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinter.java +index b2fcb2db3..33995de0a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinter.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinter.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.util.stream.Collectors.joining; ++ + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.FileText; +@@ -30,7 +32,6 @@ import java.util.List; + import java.util.Locale; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + + /** Class for constructing xpath queries to suppress nodes with specified line and column number. */ + public final class SuppressionsStringPrinter { +@@ -98,6 +99,6 @@ public final class SuppressionsStringPrinter { + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(detailAST, lineNumber, columnNumber, fileText, tabWidth); + final List suppressions = queryGenerator.generate(); +- return suppressions.stream().collect(Collectors.joining(LINE_SEPARATOR, "", LINE_SEPARATOR)); ++ return suppressions.stream().collect(joining(LINE_SEPARATOR, "", LINE_SEPARATOR)); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/ThreadModeSettings.java b/src/main/java/com/puppycrawl/tools/checkstyle/ThreadModeSettings.java +index a37dbb8f9..354abb79f 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/ThreadModeSettings.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/ThreadModeSettings.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import java.io.Serializable; + + /** +@@ -92,14 +94,12 @@ public class ThreadModeSettings implements Serializable { + */ + public final String resolveName(String name) { + if (checkerThreadsNumber > 1) { +- if (CHECKER_MODULE_NAME.equals(name)) { +- throw new IllegalArgumentException( +- "Multi thread mode for Checker module is not implemented"); +- } +- if (TREE_WALKER_MODULE_NAME.equals(name)) { +- throw new IllegalArgumentException( +- "Multi thread mode for TreeWalker module is not implemented"); +- } ++ checkArgument( ++ !CHECKER_MODULE_NAME.equals(name), ++ "Multi thread mode for Checker module is not implemented"); ++ checkArgument( ++ !TREE_WALKER_MODULE_NAME.equals(name), ++ "Multi thread mode for TreeWalker module is not implemented"); + } + + return name; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java +index 63dae146c..91199d55a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/TreeWalker.java +@@ -19,6 +19,10 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; ++import static java.util.Comparator.naturalOrder; ++import static java.util.Comparator.nullsLast; ++ + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +@@ -41,7 +45,6 @@ import java.util.Map; + import java.util.Set; + import java.util.SortedSet; + import java.util.TreeSet; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + + /** Responsible for walking an abstract syntax tree and notifying interested checks at each node. */ +@@ -369,7 +372,7 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe + .filter(ExternalResourceHolder.class::isInstance) + .map(ExternalResourceHolder.class::cast) + .flatMap(resource -> resource.getExternalResourceLocations().stream()) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + + /** +@@ -401,8 +404,8 @@ public final class TreeWalker extends AbstractFileSetCheck implements ExternalRe + private static SortedSet createNewCheckSortedSet() { + return new TreeSet<>( + Comparator.comparing(check -> check.getClass().getName()) +- .thenComparing(AbstractCheck::getId, Comparator.nullsLast(Comparator.naturalOrder())) +- .thenComparing(AbstractCheck::hashCode)); ++ .thenComparing(AbstractCheck::getId, nullsLast(naturalOrder())) ++ .thenComparingInt(AbstractCheck::hashCode)); + } + + /** State of AST. Indicates whether tree contains certain nodes. */ +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java b/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java +index 89c6082e9..8e8084abb 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/XMLLogger.java +@@ -19,6 +19,11 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.Collections.synchronizedList; ++import static java.util.Collections.unmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.AuditListener; + import com.puppycrawl.tools.checkstyle.api.AutomaticBean; +@@ -28,9 +33,7 @@ import java.io.OutputStream; + import java.io.OutputStreamWriter; + import java.io.PrintWriter; + import java.io.StringWriter; +-import java.nio.charset.StandardCharsets; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.Map; + import java.util.concurrent.ConcurrentHashMap; +@@ -90,10 +93,8 @@ public class XMLLogger extends AbstractAutomaticBean implements AuditListener { + * @throws IllegalArgumentException if outputStreamOptions is null. + */ + public XMLLogger(OutputStream outputStream, OutputStreamOptions outputStreamOptions) { +- writer = new PrintWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)); +- if (outputStreamOptions == null) { +- throw new IllegalArgumentException("Parameter outputStreamOptions can not be null"); +- } ++ writer = new PrintWriter(new OutputStreamWriter(outputStream, UTF_8)); ++ checkArgument(outputStreamOptions != null, "Parameter outputStreamOptions can not be null"); + closeStream = outputStreamOptions == OutputStreamOptions.CLOSE; + } + +@@ -328,10 +329,10 @@ public class XMLLogger extends AbstractAutomaticBean implements AuditListener { + private static final class FileMessages { + + /** The file error events. */ +- private final List errors = Collections.synchronizedList(new ArrayList<>()); ++ private final List errors = synchronizedList(new ArrayList<>()); + + /** The file exceptions. */ +- private final List exceptions = Collections.synchronizedList(new ArrayList<>()); ++ private final List exceptions = synchronizedList(new ArrayList<>()); + + /** + * Returns the file error events. +@@ -339,7 +340,7 @@ public class XMLLogger extends AbstractAutomaticBean implements AuditListener { + * @return the file error events. + */ + public List getErrors() { +- return Collections.unmodifiableList(errors); ++ return unmodifiableList(errors); + } + + /** +@@ -357,7 +358,7 @@ public class XMLLogger extends AbstractAutomaticBean implements AuditListener { + * @return the file exceptions. + */ + public List getExceptions() { +- return Collections.unmodifiableList(exceptions); ++ return unmodifiableList(exceptions); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListener.java b/src/main/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListener.java +index 088dc44ef..1893bff4c 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListener.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListener.java +@@ -19,13 +19,14 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.nio.charset.StandardCharsets.UTF_8; ++ + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.AuditListener; + import java.io.File; + import java.io.OutputStream; + import java.io.OutputStreamWriter; + import java.io.PrintWriter; +-import java.nio.charset.StandardCharsets; + + /** + * Generates suppressions.xml file, based on violations occurred. See issue scanner.getBasedir() + File.separator + name) + .map(File::new) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + } + + /** Poor man enumeration for the formatter types. */ +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractCheck.java +index 46e2b6403..6b0c78290 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.api; + ++import static java.util.Collections.unmodifiableSet; ++ + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.util.Collections; + import java.util.HashSet; +@@ -107,7 +109,7 @@ public abstract class AbstractCheck extends AbstractViolationReporter { + * @return the set of token names + */ + public final Set getTokenNames() { +- return Collections.unmodifiableSet(tokens); ++ return unmodifiableSet(tokens); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java +index 6bd874fc8..61ac08dab 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.api; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import java.util.Arrays; +@@ -161,9 +163,7 @@ public abstract class AbstractFileSetCheck extends AbstractViolationReporter + * @throws IllegalArgumentException is argument is null + */ + public final void setFileExtensions(String... extensions) { +- if (extensions == null) { +- throw new IllegalArgumentException("Extensions array can not be null"); +- } ++ checkArgument(extensions != null, "Extensions array can not be null"); + + fileExtensions = new String[extensions.length]; + for (int i = 0; i < extensions.length; i++) { +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java +index 471cbaec2..b7856f5ff 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/AuditEvent.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.api; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + /** + * Raw event for audit. + * +@@ -67,9 +69,7 @@ public final class AuditEvent { + * @throws IllegalArgumentException if {@code src} is {@code null}. + */ + public AuditEvent(Object src, String fileName, Violation violation) { +- if (src == null) { +- throw new IllegalArgumentException("null source"); +- } ++ checkArgument(src != null, "null source"); + + source = src; + this.fileName = fileName; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSet.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSet.java +index baeedbdd7..be38c1dd5 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSet.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSet.java +@@ -19,7 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.api; + +-import java.util.Collections; ++import static java.util.Collections.unmodifiableSet; ++ + import java.util.HashSet; + import java.util.Set; + +@@ -56,7 +57,7 @@ public final class BeforeExecutionFileFilterSet implements BeforeExecutionFileFi + * @return the Filters of the filter set. + */ + public Set getBeforeExecutionFileFilters() { +- return Collections.unmodifiableSet(beforeExecutionFileFilters); ++ return unmodifiableSet(beforeExecutionFileFilters); + } + + @Override +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java +index 6820beb93..f9c4cb18b 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/FileContents.java +@@ -19,12 +19,13 @@ + + package com.puppycrawl.tools.checkstyle.api; + ++import static java.util.Collections.unmodifiableMap; ++ + import com.puppycrawl.tools.checkstyle.grammar.CommentListener; + import com.puppycrawl.tools.checkstyle.utils.CheckUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.util.ArrayList; + import java.util.Collection; +-import java.util.Collections; + import java.util.HashMap; + import java.util.List; + import java.util.Map; +@@ -291,7 +292,7 @@ public final class FileContents implements CommentListener { + * @return the Map of comments + */ + public Map getSingleLineComments() { +- return Collections.unmodifiableMap(cppComments); ++ return unmodifiableMap(cppComments); + } + + /** +@@ -301,7 +302,7 @@ public final class FileContents implements CommentListener { + * @return the map of comments + */ + public Map> getBlockComments() { +- return Collections.unmodifiableMap(clangComments); ++ return unmodifiableMap(clangComments); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java +index 11303ed39..f415fe4f7 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/FilterSet.java +@@ -19,7 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.api; + +-import java.util.Collections; ++import static java.util.Collections.unmodifiableSet; ++ + import java.util.HashSet; + import java.util.Set; + +@@ -56,7 +57,7 @@ public class FilterSet implements Filter { + * @return the Filters of the filter set. + */ + public Set getFilters() { +- return Collections.unmodifiableSet(filters); ++ return unmodifiableSet(filters); + } + + @Override +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java +index 9bbe4f690..4f566ebae 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounter.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.api; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import java.util.concurrent.atomic.AtomicInteger; + + /** +@@ -40,9 +42,7 @@ public final class SeverityLevelCounter implements AuditListener { + * @throws IllegalArgumentException when level is null + */ + public SeverityLevelCounter(SeverityLevel level) { +- if (level == null) { +- throw new IllegalArgumentException("'level' cannot be null"); +- } ++ checkArgument(level != null, "'level' cannot be null"); + this.level = level; + } + +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/api/Violation.java b/src/main/java/com/puppycrawl/tools/checkstyle/api/Violation.java +index 1f68f5d4a..aa38967d9 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/api/Violation.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/api/Violation.java +@@ -381,7 +381,7 @@ public final class Violation implements Comparable { + && Objects.equals(columnNo, violation.columnNo) + && Objects.equals(columnCharIndex, violation.columnCharIndex) + && Objects.equals(tokenType, violation.tokenType) +- && Objects.equals(severityLevel, violation.severityLevel) ++ && severityLevel == violation.severityLevel + && Objects.equals(moduleId, violation.moduleId) + && Objects.equals(key, violation.key) + && Objects.equals(bundle, violation.bundle) +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java +index f76e5f809..adee722ff 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheck.java +@@ -346,8 +346,8 @@ public class AvoidEscapedUnicodeCharactersCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void beginTree(DetailAST rootAST) { + singlelineComments = getFileContents().getSingleLineComments(); + blockComments = getFileContents().getBlockComments(); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java +index bf6accd86..ad047602f 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/LineSeparatorOption.java +@@ -19,7 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks; + +-import java.nio.charset.StandardCharsets; ++import static java.nio.charset.StandardCharsets.US_ASCII; ++ + import java.util.Arrays; + + /** +@@ -55,7 +56,7 @@ public enum LineSeparatorOption { + * @param sep the line separator, e.g. "\r\n" + */ + LineSeparatorOption(String sep) { +- lineSeparator = sep.getBytes(StandardCharsets.US_ASCII); ++ lineSeparator = sep.getBytes(US_ASCII); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheck.java +index ea9b42f23..c49f03ed4 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks; + ++import static java.util.Collections.enumeration; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; + import com.puppycrawl.tools.checkstyle.api.FileText; +@@ -27,7 +29,6 @@ import java.io.IOException; + import java.io.InputStream; + import java.nio.file.Files; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.Enumeration; + import java.util.Iterator; + import java.util.List; +@@ -214,7 +215,7 @@ public class OrderedPropertiesCheck extends AbstractFileSetCheck { + /** Returns a copy of the keys. */ + @Override + public Enumeration keys() { +- return Collections.enumeration(keyList); ++ return enumeration(keyList); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java +index e725a1977..b31c3fa63 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolder.java +@@ -19,12 +19,14 @@ + + package com.puppycrawl.tools.checkstyle.checks; + ++import static com.google.common.base.Preconditions.checkArgument; ++ ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +-import java.util.Collections; + import java.util.HashMap; + import java.util.LinkedList; + import java.util.List; +@@ -372,7 +374,7 @@ public class SuppressWarningsHolder extends AbstractCheck { + */ + private static List getAllAnnotationValues(DetailAST ast) { + // get values of annotation +- List values = Collections.emptyList(); ++ List values = ImmutableList.of(); + final DetailAST lparenAST = ast.findFirstToken(TokenTypes.LPAREN); + if (lparenAST != null) { + final DetailAST nextAST = lparenAST.getNextSibling(); +@@ -454,9 +456,7 @@ public class SuppressWarningsHolder extends AbstractCheck { + * @throws IllegalArgumentException if the AST is invalid + */ + private static String getIdentifier(DetailAST ast) { +- if (ast == null) { +- throw new IllegalArgumentException("Identifier AST expected, but get null."); +- } ++ checkArgument(ast != null, "Identifier AST expected, but get null."); + final String identifier; + if (ast.getType() == TokenTypes.IDENT) { + identifier = ast.getText(); +@@ -512,7 +512,7 @@ public class SuppressWarningsHolder extends AbstractCheck { + final List annotationValues; + switch (ast.getType()) { + case TokenTypes.EXPR: +- annotationValues = Collections.singletonList(getStringExpr(ast)); ++ annotationValues = ImmutableList.of(getStringExpr(ast)); + break; + case TokenTypes.ANNOTATION_ARRAY_INIT: + annotationValues = findAllExpressionsInChildren(ast); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java +index 7e7a452e4..5e5a109f7 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheck.java +@@ -19,6 +19,10 @@ + + package com.puppycrawl.tools.checkstyle.checks; + ++import static java.util.Collections.unmodifiableSet; ++ ++import com.google.common.collect.ImmutableSet; ++import com.google.common.collect.Sets; + import com.puppycrawl.tools.checkstyle.Definitions; + import com.puppycrawl.tools.checkstyle.GlobalStatefulCheck; + import com.puppycrawl.tools.checkstyle.LocalizedMessage; +@@ -31,8 +35,6 @@ import java.io.File; + import java.io.InputStream; + import java.nio.file.Files; + import java.nio.file.NoSuchFileException; +-import java.util.Arrays; +-import java.util.Collections; + import java.util.HashSet; + import java.util.Locale; + import java.util.Map; +@@ -46,7 +48,6 @@ import java.util.TreeSet; + import java.util.concurrent.ConcurrentHashMap; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; + +@@ -271,7 +272,7 @@ public class TranslationCheck extends AbstractFileSetCheck { + * @param translationCodes language codes. + */ + public void setRequiredTranslations(String... translationCodes) { +- requiredTranslations = Arrays.stream(translationCodes).collect(Collectors.toSet()); ++ requiredTranslations = ImmutableSet.copyOf(translationCodes); + validateUserSpecifiedLanguageCodes(requiredTranslations); + } + +@@ -439,7 +440,7 @@ public class TranslationCheck extends AbstractFileSetCheck { + final ResourceBundle newBundle = new ResourceBundle(baseName, path, extension); + final Optional bundle = findBundle(resourceBundles, newBundle); + if (bundle.isPresent()) { +- bundle.get().addFile(currentFile); ++ bundle.orElseThrow().addFile(currentFile); + } else { + newBundle.addFile(currentFile); + resourceBundles.add(newBundle); +@@ -542,9 +543,7 @@ public class TranslationCheck extends AbstractFileSetCheck { + for (Entry> fileKey : fileKeys.entrySet()) { + final Set currentFileKeys = fileKey.getValue(); + final Set missingKeys = +- keysThatMustExist.stream() +- .filter(key -> !currentFileKeys.contains(key)) +- .collect(Collectors.toSet()); ++ Sets.difference(keysThatMustExist, currentFileKeys).immutableCopy(); + if (!missingKeys.isEmpty()) { + final MessageDispatcher dispatcher = getMessageDispatcher(); + final String path = fileKey.getKey().getAbsolutePath(); +@@ -662,7 +661,7 @@ public class TranslationCheck extends AbstractFileSetCheck { + * @return the set of files + */ + public Set getFiles() { +- return Collections.unmodifiableSet(files); ++ return unmodifiableSet(files); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java +index bd0f78839..fb5d09237 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -128,7 +129,7 @@ public class UncommentedMainCheck extends AbstractCheck { + + /** Set of possible String array types. */ + private static final Set STRING_PARAMETER_NAMES = +- Set.of( ++ ImmutableSet.of( + String[].class.getCanonicalName(), + String.class.getCanonicalName(), + String[].class.getSimpleName(), +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java +index 293a3190a..ccfbfce9b 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.annotation; + ++import static java.util.Objects.requireNonNullElse; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -237,8 +239,7 @@ public final class MissingOverrideCheck extends AbstractCheck { + final DetailAST startNode; + if (modifiers.hasChildren()) { + startNode = +- Optional.ofNullable(ast.getFirstChild().findFirstToken(TokenTypes.ANNOTATION)) +- .orElse(modifiers); ++ requireNonNullElse(ast.getFirstChild().findFirstToken(TokenTypes.ANNOTATION), modifiers); + } else { + startNode = ast.findFirstToken(TokenTypes.TYPE); + } +@@ -249,6 +250,6 @@ public final class MissingOverrideCheck extends AbstractCheck { + .map(DetailAST::getText) + .filter(JavadocUtil::isJavadocComment) + .findFirst(); +- return javadoc.isPresent() && MATCH_INHERIT_DOC.matcher(javadoc.get()).find(); ++ return javadoc.isPresent() && MATCH_INHERIT_DOC.matcher(javadoc.orElseThrow()).find(); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java +index 9a1c93f9d..580b2267f 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheck.java +@@ -19,13 +19,14 @@ + + package com.puppycrawl.tools.checkstyle.checks.annotation; + ++import static java.util.Objects.requireNonNullElse; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.AnnotationUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +-import java.util.Objects; + import java.util.regex.Matcher; + import java.util.regex.Pattern; + +@@ -233,7 +234,7 @@ public class SuppressWarningsCheck extends AbstractCheck { + final DetailAST token = warningHolder.findFirstToken(TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR); + + // case like '@SuppressWarnings(value = UNUSED)' +- final DetailAST parent = Objects.requireNonNullElse(token, warningHolder); ++ final DetailAST parent = requireNonNullElse(token, warningHolder); + DetailAST warning = parent.findFirstToken(TokenTypes.EXPR); + + // rare case with empty array ex: @SuppressWarnings({}) +@@ -313,10 +314,10 @@ public class SuppressWarningsCheck extends AbstractCheck { + final DetailAST annValuePair = + annotation.findFirstToken(TokenTypes.ANNOTATION_MEMBER_VALUE_PAIR); + +- final DetailAST annArrayInitParent = Objects.requireNonNullElse(annValuePair, annotation); ++ final DetailAST annArrayInitParent = requireNonNullElse(annValuePair, annotation); + final DetailAST annArrayInit = + annArrayInitParent.findFirstToken(TokenTypes.ANNOTATION_ARRAY_INIT); +- return Objects.requireNonNullElse(annArrayInit, annotation); ++ return requireNonNullElse(annArrayInit, annotation); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java +index 85e09c024..687cbdea1 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheck.java +@@ -23,7 +23,6 @@ import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +-import java.util.Objects; + + /** + * Check that the {@code default} is after all the cases in a {@code switch} statement. +@@ -176,14 +175,14 @@ public class DefaultComesLastCheck extends AbstractCheck { + final boolean isSwitchRule = defaultGroupAST.getType() == TokenTypes.SWITCH_RULE; + + if (skipIfLastAndSharedWithCase && !isSwitchRule) { +- if (Objects.nonNull(findNextSibling(ast, TokenTypes.LITERAL_CASE))) { ++ if (findNextSibling(ast, TokenTypes.LITERAL_CASE) != null) { + log(ast, MSG_KEY_SKIP_IF_LAST_AND_SHARED_WITH_CASE); + } else if (ast.getPreviousSibling() == null +- && Objects.nonNull(findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP))) { ++ && findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP) != null) { + log(ast, MSG_KEY); + } +- } else if (Objects.nonNull(findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP)) +- || Objects.nonNull(findNextSibling(defaultGroupAST, TokenTypes.SWITCH_RULE))) { ++ } else if (findNextSibling(defaultGroupAST, TokenTypes.CASE_GROUP) != null ++ || findNextSibling(defaultGroupAST, TokenTypes.SWITCH_RULE) != null) { + log(ast, MSG_KEY); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java +index 8c9ef4db1..844a4500f 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheck.java +@@ -19,12 +19,13 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.Collections.unmodifiableSet; ++ + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CheckUtil; +-import java.util.Collections; + import java.util.HashMap; + import java.util.HashSet; + import java.util.Map; +@@ -585,7 +586,7 @@ public class EqualsAvoidNullCheck extends AbstractCheck { + * @return children of this frame. + */ + public Set getChildren() { +- return Collections.unmodifiableSet(children); ++ return unmodifiableSet(children); + } + + /** +@@ -651,7 +652,7 @@ public class EqualsAvoidNullCheck extends AbstractCheck { + * @return method calls of this frame. + */ + public Set getMethodCalls() { +- return Collections.unmodifiableSet(methodCalls); ++ return unmodifiableSet(methodCalls); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java +index e904aba09..41f61fe6b 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheck.java +@@ -271,7 +271,7 @@ public class FinalLocalVariableCheck extends AbstractCheck { + if (isAssignOperator(parentType) && isFirstChild(ast)) { + final Optional candidate = getFinalCandidate(ast); + if (candidate.isPresent()) { +- determineAssignmentConditions(ast, candidate.get()); ++ determineAssignmentConditions(ast, candidate.orElseThrow()); + currentScopeAssignedVariables.peek().add(ast); + } + removeFinalVariableCandidateFromStack(ast); +@@ -771,7 +771,7 @@ public class FinalLocalVariableCheck extends AbstractCheck { + final Optional candidate = + Optional.ofNullable(scope.get(ast.getText())); + if (candidate.isPresent()) { +- storedVariable = candidate.get().variableIdent; ++ storedVariable = candidate.orElseThrow().variableIdent; + } + if (storedVariable != null && isSameVariables(storedVariable, ast)) { + result = candidate; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java +index 8cc60cace..2e470bdb2 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.stream.Collectors.toCollection; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -28,7 +30,6 @@ import com.puppycrawl.tools.checkstyle.utils.CheckUtil; + import java.util.Arrays; + import java.util.HashSet; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Checks that certain exception types do not appear in a {@code catch} statement. +@@ -157,7 +158,7 @@ public final class IllegalCatchCheck extends AbstractCheck { + "java.lang.RuntimeException", + "java.lang.Throwable", + }) +- .collect(Collectors.toCollection(HashSet::new)); ++ .collect(toCollection(HashSet::new)); + + /** + * Setter to specify exception class names to reject. +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java +index fc2fb707c..3f28c25dc 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheck.java +@@ -19,16 +19,15 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.FullIdent; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +-import java.util.Arrays; + import java.util.HashSet; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Checks for illegal instantiations where a factory method is preferred. +@@ -391,6 +390,6 @@ public class IllegalInstantiationCheck extends AbstractCheck { + * @param names class names + */ + public void setClasses(String... names) { +- classes = Arrays.stream(names).collect(Collectors.toSet()); ++ classes = ImmutableSet.copyOf(names); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java +index 6cf4a66f4..3e56d5c3f 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.stream.Collectors.toCollection; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -30,7 +32,6 @@ import java.util.Arrays; + import java.util.Collections; + import java.util.HashSet; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Checks that specified types are not declared to be thrown. Declaring that a method throws {@code +@@ -155,7 +156,7 @@ public final class IllegalThrowsCheck extends AbstractCheck { + new String[] { + "finalize", + }) +- .collect(Collectors.toCollection(HashSet::new)); ++ .collect(toCollection(HashSet::new)); + + /** Specify throw class names to reject. */ + private final Set illegalClassNames = +@@ -168,7 +169,7 @@ public final class IllegalThrowsCheck extends AbstractCheck { + "java.lang.RuntimeException", + "java.lang.Throwable", + }) +- .collect(Collectors.toCollection(HashSet::new)); ++ .collect(toCollection(HashSet::new)); + + /** + * Allow to ignore checking overridden methods (marked with {@code Override} or {@code +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java +index e0173f9a2..a4372b907 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheck.java +@@ -19,12 +19,14 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.Objects.requireNonNullElse; ++import static java.util.regex.Pattern.CASE_INSENSITIVE; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +-import java.util.Objects; + import java.util.regex.Pattern; + + /** +@@ -203,7 +205,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { + * @param message custom message which should be used to report about violations. + */ + public void setMessage(String message) { +- this.message = Objects.requireNonNullElse(message, ""); ++ this.message = requireNonNullElse(message, ""); + } + + /** +@@ -233,7 +235,7 @@ public class IllegalTokenTextCheck extends AbstractCheck { + private void updateRegexp() { + final int compileFlags; + if (ignoreCase) { +- compileFlags = Pattern.CASE_INSENSITIVE; ++ compileFlags = CASE_INSENSITIVE; + } else { + compileFlags = 0; + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheck.java +index fd1474e3d..76d61cb80 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -26,7 +28,6 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import com.puppycrawl.tools.checkstyle.xpath.AbstractNode; + import com.puppycrawl.tools.checkstyle.xpath.RootNode; + import java.util.List; +-import java.util.stream.Collectors; + import net.sf.saxon.Configuration; + import net.sf.saxon.om.Item; + import net.sf.saxon.sxpath.XPathDynamicContext; +@@ -280,7 +281,7 @@ public class MatchXpathCheck extends AbstractCheck { + final List matchingItems = xpathExpression.evaluate(xpathDynamicContext); + return matchingItems.stream() + .map(item -> (DetailAST) ((AbstractNode) item).getUnderlyingNode()) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + } catch (XPathException ex) { + throw new IllegalStateException("Evaluation of Xpath query failed: " + query, ex); + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java +index 317178dc3..27fd1dd1c 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import com.google.common.collect.Sets; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -31,7 +32,6 @@ import java.util.HashSet; + import java.util.LinkedList; + import java.util.List; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Checks that for loop control variables are not modified inside the for block. An example is: +@@ -337,9 +337,7 @@ public final class ModifiedControlVariableCheck extends AbstractCheck { + private static Set getVariablesManagedByForLoop(DetailAST ast) { + final Set initializedVariables = getForInitVariables(ast); + final Set iteratingVariables = getForIteratorVariables(ast); +- return initializedVariables.stream() +- .filter(iteratingVariables::contains) +- .collect(Collectors.toSet()); ++ return Sets.intersection(initializedVariables, iteratingVariables).immutableCopy(); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java +index 3b53f590c..cbab9a060 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -26,7 +27,6 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CheckUtil; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.ArrayDeque; +-import java.util.Collections; + import java.util.Deque; + import java.util.HashSet; + import java.util.Set; +@@ -138,7 +138,7 @@ public final class ParameterAssignmentCheck extends AbstractCheck { + public void beginTree(DetailAST rootAST) { + // clear data + parameterNamesStack.clear(); +- parameterNames = Collections.emptySet(); ++ parameterNames = ImmutableSet.of(); + } + + @Override +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheck.java +index cd5c0ffc2..965a25c13 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++ + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -36,7 +38,6 @@ import java.util.List; + import java.util.Map; + import java.util.Optional; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Checks that a local variable is declared and/or assigned, but not used. Doesn't support typeDeclWithSameName = typeDeclWithSameName(shortNameOfClass); +@@ -560,7 +561,7 @@ public class UnusedLocalVariableCheck extends AbstractCheck { + typeDeclDesc -> { + return hasSameNameAsSuperClass(superClassName, typeDeclDesc); + }) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java +index 92b3b97e1..a0c4d3a37 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.coding; + ++import static java.util.Objects.requireNonNullElse; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -29,7 +31,6 @@ import java.util.AbstractMap.SimpleEntry; + import java.util.ArrayList; + import java.util.List; + import java.util.Map.Entry; +-import java.util.Objects; + import java.util.Optional; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +@@ -605,8 +606,7 @@ public class VariableDeclarationUsageDistanceCheck extends AbstractCheck { + exprWithVariableUsage = blockWithVariableUsage.getFirstChild(); + } + currentScopeAst = exprWithVariableUsage; +- variableUsageAst = +- Objects.requireNonNullElse(exprWithVariableUsage, blockWithVariableUsage); ++ variableUsageAst = requireNonNullElse(exprWithVariableUsage, blockWithVariableUsage); + } + + // If there's no any variable usage, then distance = 0. +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java +index ae50d5d74..615565966 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheck.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.checks.design; + ++import static java.util.Objects.requireNonNullElse; ++ ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -27,14 +30,11 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; + import com.puppycrawl.tools.checkstyle.utils.ScopeUtil; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; +-import java.util.Arrays; +-import java.util.Objects; + import java.util.Optional; + import java.util.Set; + import java.util.function.Predicate; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + + /** + * Checks that classes are designed for extension (subclass creation). +@@ -277,11 +277,10 @@ public class DesignForExtensionCheck extends AbstractCheck { + + /** Specify annotations which allow the check to skip the method from validation. */ + private Set ignoredAnnotations = +- Arrays.stream( +- new String[] { +- "Test", "Before", "After", "BeforeClass", "AfterClass", +- }) +- .collect(Collectors.toSet()); ++ ImmutableSet.copyOf( ++ new String[] { ++ "Test", "Before", "After", "BeforeClass", "AfterClass", ++ }); + + /** + * Specify the comment text pattern which qualifies a method as designed for extension. Supports +@@ -295,7 +294,7 @@ public class DesignForExtensionCheck extends AbstractCheck { + * @param ignoredAnnotations method annotations. + */ + public void setIgnoredAnnotations(String... ignoredAnnotations) { +- this.ignoredAnnotations = Arrays.stream(ignoredAnnotations).collect(Collectors.toSet()); ++ this.ignoredAnnotations = ImmutableSet.copyOf(ignoredAnnotations); + } + + /** +@@ -495,7 +494,7 @@ public class DesignForExtensionCheck extends AbstractCheck { + */ + private static String getAnnotationName(DetailAST annotation) { + final DetailAST dotAst = annotation.findFirstToken(TokenTypes.DOT); +- final DetailAST parent = Objects.requireNonNullElse(dotAst, annotation); ++ final DetailAST parent = requireNonNullElse(dotAst, annotation); + return parent.findFirstToken(TokenTypes.IDENT).getText(); + } + +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java +index 7f3061ea9..37c16176a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.design; + ++import static java.util.Comparator.comparingInt; ++ + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -330,7 +332,7 @@ public class FinalClassCheck extends AbstractCheck { + private Optional getNearestClassWithSameName( + String className, ToIntFunction countProvider) { + final String dotAndClassName = PACKAGE_SEPARATOR.concat(className); +- final Comparator longestMatch = Comparator.comparingInt(countProvider); ++ final Comparator longestMatch = comparingInt(countProvider); + return innerClasses.entrySet().stream() + .filter(entry -> entry.getKey().endsWith(dotAndClassName)) + .map(Map.Entry::getValue) +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java +index 290665dc4..a5d63cde4 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheck.java +@@ -19,11 +19,12 @@ + + package com.puppycrawl.tools.checkstyle.checks.design; + ++import static java.util.Objects.requireNonNullElse; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +-import java.util.Objects; + + /** + * Restricts throws statements to a specified count. Methods with "Override" or "java.lang.Override" +@@ -274,7 +275,7 @@ public final class ThrowsCountCheck extends AbstractCheck { + */ + private static String getAnnotationName(DetailAST annotation) { + final DetailAST dotAst = annotation.findFirstToken(TokenTypes.DOT); +- final DetailAST parent = Objects.requireNonNullElse(dotAst, annotation); ++ final DetailAST parent = requireNonNullElse(dotAst, annotation); + return parent.findFirstToken(TokenTypes.IDENT).getText(); + } + +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java +index 0aa8452a5..af510c0bc 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheck.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.checks.design; + ++import static java.util.stream.Collectors.toCollection; ++ ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -33,7 +36,6 @@ import java.util.HashSet; + import java.util.List; + import java.util.Set; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + + /** + * Checks visibility of class members. Only static final, immutable or annotated by specified +@@ -395,7 +397,7 @@ public class VisibilityModifierCheck extends AbstractCheck { + + /** Default ignore annotations canonical names. */ + private static final Set DEFAULT_IGNORE_ANNOTATIONS = +- Set.of( ++ ImmutableSet.of( + "org.junit.Rule", + "org.junit.ClassRule", + "com.google.common.annotations.VisibleForTesting"); +@@ -921,7 +923,7 @@ public class VisibilityModifierCheck extends AbstractCheck { + private static Set getClassShortNames(Set canonicalClassNames) { + return canonicalClassNames.stream() + .map(CommonUtil::baseClassName) +- .collect(Collectors.toCollection(HashSet::new)); ++ .collect(toCollection(HashSet::new)); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java +index af7b6c6f6..71e9149bc 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/AbstractHeaderCheck.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.checks.header; + ++import static com.google.common.base.Preconditions.checkArgument; ++ ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.PropertyType; + import com.puppycrawl.tools.checkstyle.XdocsPropertyType; + import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; +@@ -36,7 +39,6 @@ import java.nio.charset.Charset; + import java.nio.charset.StandardCharsets; + import java.nio.charset.UnsupportedCharsetException; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + import java.util.Set; + import java.util.regex.Pattern; +@@ -118,10 +120,9 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck + * @throws IllegalArgumentException if header has already been set + */ + private void checkHeaderNotInitialized() { +- if (!readerLines.isEmpty()) { +- throw new IllegalArgumentException( +- "header has already been set - " + "set either header or headerFile, not both"); +- } ++ checkArgument( ++ readerLines.isEmpty(), ++ "header has already been set - " + "set either header or headerFile, not both"); + } + + /** +@@ -192,9 +193,9 @@ public abstract class AbstractHeaderCheck extends AbstractFileSetCheck + final Set result; + + if (headerFile == null) { +- result = Collections.emptySet(); ++ result = ImmutableSet.of(); + } else { +- result = Collections.singleton(headerFile.toString()); ++ result = ImmutableSet.of(headerFile.toString()); + } + + return result; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java +index d708945ef..af78449dd 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.header; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.FileText; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +@@ -324,9 +326,7 @@ public class RegexpHeaderCheck extends AbstractHeaderCheck { + @Override + public void setHeader(String header) { + if (!CommonUtil.isBlank(header)) { +- if (!CommonUtil.isPatternValid(header)) { +- throw new IllegalArgumentException("Unable to parse format: " + header); +- } ++ checkArgument(CommonUtil.isPatternValid(header), "Unable to parse format: %s", header); + super.setHeader(header); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java +index f82762f6c..2726d125a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.imports; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -1073,10 +1075,10 @@ public class CustomImportOrderCheck extends AbstractCheck { + } else if (ruleStr.startsWith(SAME_PACKAGE_RULE_GROUP)) { + final String rule = ruleStr.substring(ruleStr.indexOf('(') + 1, ruleStr.indexOf(')')); + samePackageMatchingDepth = Integer.parseInt(rule); +- if (samePackageMatchingDepth <= 0) { +- throw new IllegalArgumentException( +- "SAME_PACKAGE rule parameter should be positive integer: " + ruleStr); +- } ++ checkArgument( ++ samePackageMatchingDepth > 0, ++ "SAME_PACKAGE rule parameter should be positive integer: %s", ++ ruleStr); + customOrderRules.add(SAME_PACKAGE_RULE_GROUP); + } else { + throw new IllegalStateException("Unexpected rule: " + ruleStr); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java +index d08093cef..c79d23ff3 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.imports; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +@@ -27,7 +28,6 @@ import com.puppycrawl.tools.checkstyle.api.ExternalResourceHolder; + import com.puppycrawl.tools.checkstyle.api.FullIdent; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import java.net.URI; +-import java.util.Collections; + import java.util.Set; + import java.util.regex.Pattern; + +@@ -448,8 +448,8 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void beginTree(DetailAST rootAST) { + currentImportControl = null; + processCurrentFile = path.matcher(getFilePath()).find(); +@@ -488,7 +488,7 @@ public class ImportControlCheck extends AbstractCheck implements ExternalResourc + + @Override + public Set getExternalResourceLocations() { +- return Collections.singleton(file.toString()); ++ return ImmutableSet.of(file.toString()); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java +index 04c7e66bf..e9ce50f34 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.imports; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -1011,9 +1013,7 @@ public class ImportOrderCheck extends AbstractCheck { + // matches any package + grp = Pattern.compile(""); + } else if (CommonUtil.startsWithChar(pkg, '/')) { +- if (!CommonUtil.endsWithChar(pkg, '/')) { +- throw new IllegalArgumentException("Invalid group: " + pkg); +- } ++ checkArgument(CommonUtil.endsWithChar(pkg, '/'), "Invalid group: %s", pkg); + pkg = pkg.substring(1, pkg.length() - 1); + grp = Pattern.compile(pkg); + } else { +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java +index e609e590f..bf08b4f75 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheck.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.checks.javadoc; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++ + import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser; + import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser.ParseErrorMessage; + import com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser.ParseStatus; +@@ -36,7 +38,6 @@ import java.util.HashSet; + import java.util.Locale; + import java.util.Map; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Base class for Checks that process Javadoc comments. +@@ -177,7 +178,7 @@ public abstract class AbstractJavadocCheck extends AbstractCheck { + validateDefaultJavadocTokens(); + if (javadocTokens.isEmpty()) { + javadocTokens.addAll( +- Arrays.stream(getDefaultJavadocTokens()).boxed().collect(Collectors.toList())); ++ Arrays.stream(getDefaultJavadocTokens()).boxed().collect(toImmutableList())); + } else { + final int[] acceptableJavadocTokens = getAcceptableJavadocTokens(); + Arrays.sort(acceptableJavadocTokens); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheck.java +index 8f72d0f76..25ae56e14 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheck.java +@@ -19,14 +19,13 @@ + + package com.puppycrawl.tools.checkstyle.checks.javadoc; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.DetailNode; + import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; +-import java.util.Arrays; + import java.util.Set; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + + /** + * Checks that a allowedAnnotations = Set.of("Override"); ++ private Set allowedAnnotations = ImmutableSet.of("Override"); + + /** + * Setter to control whether to validate {@code throws} tags. +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java +index c332705f8..4474ce968 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheck.java +@@ -391,8 +391,8 @@ public class JavadocStyleCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void visitToken(DetailAST ast) { + if (shouldCheck(ast)) { + final FileContents contents = getFileContents(); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java +index 8e71e1696..4f1b17e1b 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfo.java +@@ -19,6 +19,10 @@ + + package com.puppycrawl.tools.checkstyle.checks.javadoc; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static java.util.function.Function.identity; ++import static java.util.stream.Collectors.toUnmodifiableMap; ++ + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.Scope; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +@@ -27,8 +31,6 @@ import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.Arrays; + import java.util.BitSet; + import java.util.Map; +-import java.util.function.Function; +-import java.util.stream.Collectors; + + /** + * This enum defines the various Javadoc tags and their properties. +@@ -298,11 +300,9 @@ public enum JavadocTagInfo { + static { + final JavadocTagInfo[] values = values(); + TEXT_TO_TAG = +- Arrays.stream(values) +- .collect(Collectors.toUnmodifiableMap(JavadocTagInfo::getText, Function.identity())); ++ Arrays.stream(values).collect(toUnmodifiableMap(JavadocTagInfo::getText, identity())); + NAME_TO_TAG = +- Arrays.stream(values) +- .collect(Collectors.toUnmodifiableMap(JavadocTagInfo::getName, Function.identity())); ++ Arrays.stream(values).collect(toUnmodifiableMap(JavadocTagInfo::getName, identity())); + } + + /** The tag text. * */ +@@ -373,15 +373,11 @@ public enum JavadocTagInfo { + * @throws IllegalArgumentException if the text is not a valid tag + */ + public static JavadocTagInfo fromText(final String text) { +- if (text == null) { +- throw new IllegalArgumentException("the text is null"); +- } ++ checkArgument(text != null, "the text is null"); + + final JavadocTagInfo tag = TEXT_TO_TAG.get(text); + +- if (tag == null) { +- throw new IllegalArgumentException("the text [" + text + "] is not a valid Javadoc tag text"); +- } ++ checkArgument(tag != null, "the text [%s] is not a valid Javadoc tag text", text); + + return tag; + } +@@ -396,15 +392,11 @@ public enum JavadocTagInfo { + * {@link JavadocTagInfo#isValidName(String)} + */ + public static JavadocTagInfo fromName(final String name) { +- if (name == null) { +- throw new IllegalArgumentException("the name is null"); +- } ++ checkArgument(name != null, "the name is null"); + + final JavadocTagInfo tag = NAME_TO_TAG.get(name); + +- if (tag == null) { +- throw new IllegalArgumentException("the name [" + name + "] is not a valid Javadoc tag name"); +- } ++ checkArgument(tag != null, "the name [%s] is not a valid Javadoc tag name", name); + + return tag; + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java +index 02c46993b..ba8cdb4eb 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.javadoc; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -441,7 +442,7 @@ public class JavadocTypeCheck extends AbstractCheck { + * Specify annotations that allow skipping validation at all. Only short names are allowed, e.g. + * {@code Generated}. + */ +- private Set allowedAnnotations = Set.of("Generated"); ++ private Set allowedAnnotations = ImmutableSet.of("Generated"); + + /** + * Setter to specify the visibility scope where Javadoc comments are checked. +@@ -530,8 +531,8 @@ public class JavadocTypeCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void visitToken(DetailAST ast) { + if (shouldCheck(ast)) { + final FileContents contents = getFileContents(); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java +index 02a2a9364..be8a324b0 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheck.java +@@ -223,8 +223,8 @@ public class JavadocVariableCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void visitToken(DetailAST ast) { + if (shouldCheck(ast)) { + final FileContents contents = getFileContents(); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheck.java +index 6ff9684fc..f81f9fd2a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.javadoc; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -262,7 +263,7 @@ public class MissingJavadocMethodCheck extends AbstractCheck { + private Pattern ignoreMethodNamesRegex; + + /** Configure annotations that allow missed documentation. */ +- private Set allowedAnnotations = Set.of("Override"); ++ private Set allowedAnnotations = ImmutableSet.of("Override"); + + /** + * Setter to configure annotations that allow missed documentation. +@@ -340,8 +341,8 @@ public class MissingJavadocMethodCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public final void visitToken(DetailAST ast) { + final Scope theScope = ScopeUtil.getScope(ast); + if (shouldCheck(ast, theScope)) { +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheck.java +index 09f90d7ce..3fd8e9fd3 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheck.java +@@ -129,7 +129,7 @@ public class MissingJavadocPackageCheck extends AbstractCheck { + .map(DetailAST::getFirstChild); + boolean result = false; + if (firstAnnotationChild.isPresent()) { +- for (DetailAST child = firstAnnotationChild.get(); ++ for (DetailAST child = firstAnnotationChild.orElseThrow(); + child != null; + child = child.getNextSibling()) { + if (isJavadoc(child)) { +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java +index 02027c5c7..9e77b46da 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.javadoc; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -178,7 +179,7 @@ public class MissingJavadocTypeCheck extends AbstractCheck { + * Specify annotations that allow missed documentation. If annotation is present in target sources + * in multiple forms of qualified name, all forms should be listed in this property. + */ +- private Set skipAnnotations = Set.of("Generated"); ++ private Set skipAnnotations = ImmutableSet.of("Generated"); + + /** + * Setter to specify the visibility scope where Javadoc comments are checked. +@@ -231,8 +232,8 @@ public class MissingJavadocTypeCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void visitToken(DetailAST ast) { + if (shouldCheck(ast)) { + final FileContents contents = getFileContents(); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java +index 27caccbf2..b1c6ffec8 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheck.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.javadoc; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.DetailNode; +@@ -239,7 +240,7 @@ public class SingleLineJavadocCheck extends AbstractJavadocCheck { + * href="https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#CHDBEFIF"> + * block tags which are ignored by the check. + */ +- private Set ignoredTags = Set.of(); ++ private Set ignoredTags = ImmutableSet.of(); + + /** + * Control whether extractInlineTags(String... lines) { + for (String line : lines) { +- if (line.indexOf(LINE_FEED) != -1 || line.indexOf(CARRIAGE_RETURN) != -1) { +- throw new IllegalArgumentException("comment lines cannot contain newlines"); +- } ++ checkArgument( ++ line.indexOf(LINE_FEED) == -1 && line.indexOf(CARRIAGE_RETURN) == -1, ++ "comment lines cannot contain newlines"); + } + + final String commentText = convertLinesToString(lines); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java +index b0b79a965..424dabe94 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/metrics/AbstractClassCouplingCheck.java +@@ -19,6 +19,11 @@ + + package com.puppycrawl.tools.checkstyle.checks.metrics; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.collect.ImmutableList.toImmutableList; ++import static java.util.function.Predicate.not; ++ ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -29,7 +34,6 @@ import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.ArrayDeque; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.Deque; + import java.util.HashMap; + import java.util.List; +@@ -37,9 +41,7 @@ import java.util.Map; + import java.util.Optional; + import java.util.Set; + import java.util.TreeSet; +-import java.util.function.Predicate; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + + /** Base class for coupling calculation. */ + @FileStatefulCheck +@@ -124,7 +126,7 @@ public abstract class AbstractClassCouplingCheck extends AbstractCheck { + "Stream"); + + /** Package names to ignore. */ +- private static final Set DEFAULT_EXCLUDED_PACKAGES = Collections.emptySet(); ++ private static final Set DEFAULT_EXCLUDED_PACKAGES = ImmutableSet.of(); + + /** Pattern to match brackets in a full type name. */ + private static final Pattern BRACKET_PATTERN = Pattern.compile("\\[[^]]*]"); +@@ -211,13 +213,11 @@ public abstract class AbstractClassCouplingCheck extends AbstractCheck { + */ + public final void setExcludedPackages(String... excludedPackages) { + final List invalidIdentifiers = +- Arrays.stream(excludedPackages) +- .filter(Predicate.not(CommonUtil::isName)) +- .collect(Collectors.toList()); +- if (!invalidIdentifiers.isEmpty()) { +- throw new IllegalArgumentException( +- "the following values are not valid identifiers: " + invalidIdentifiers); +- } ++ Arrays.stream(excludedPackages).filter(not(CommonUtil::isName)).collect(toImmutableList()); ++ checkArgument( ++ invalidIdentifiers.isEmpty(), ++ "the following values are not valid identifiers: %s", ++ invalidIdentifiers); + + this.excludedPackages = Set.of(excludedPackages); + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java +index b37b6ef0d..1537560d1 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheck.java +@@ -19,18 +19,17 @@ + + package com.puppycrawl.tools.checkstyle.checks.naming; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CheckUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +-import java.util.Arrays; + import java.util.HashSet; + import java.util.LinkedList; + import java.util.List; + import java.util.Set; +-import java.util.stream.Collectors; + + /** + * Validates abbreviations (consecutive capital letters) length in identifier name, it also allows +@@ -401,7 +400,7 @@ public class AbbreviationAsWordInNameCheck extends AbstractCheck { + */ + public void setAllowedAbbreviations(String... allowedAbbreviations) { + if (allowedAbbreviations != null) { +- this.allowedAbbreviations = Arrays.stream(allowedAbbreviations).collect(Collectors.toSet()); ++ this.allowedAbbreviations = ImmutableSet.copyOf(allowedAbbreviations); + } + } + +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheck.java +index d55771317..375f938b0 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheck.java +@@ -22,7 +22,6 @@ package com.puppycrawl.tools.checkstyle.checks.naming; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; +-import java.util.Objects; + + /** + * Checks lambda parameter names. +@@ -111,7 +110,7 @@ public class LambdaParameterNameCheck extends AbstractNameCheck { + public void visitToken(DetailAST ast) { + final boolean isInSwitchRule = ast.getParent().getType() == TokenTypes.SWITCH_RULE; + +- if (Objects.nonNull(ast.findFirstToken(TokenTypes.PARAMETERS))) { ++ if (ast.findFirstToken(TokenTypes.PARAMETERS) != null) { + final DetailAST parametersNode = ast.findFirstToken(TokenTypes.PARAMETERS); + TokenUtil.forEachChild(parametersNode, TokenTypes.PARAMETER_DEF, super::visitToken); + } else if (!isInSwitchRule) { +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java +index aaf9946e9..eb7d4c373 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheck.java +@@ -255,8 +255,8 @@ public class ParameterNameCheck extends AbstractNameCheck { + + if (annotation.isPresent()) { + final Optional overrideToken = +- Optional.ofNullable(annotation.get().findFirstToken(TokenTypes.IDENT)); +- if (overrideToken.isPresent() && "Override".equals(overrideToken.get().getText())) { ++ Optional.ofNullable(annotation.orElseThrow().findFirstToken(TokenTypes.IDENT)); ++ if (overrideToken.isPresent() && "Override".equals(overrideToken.orElseThrow().getText())) { + overridden = true; + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java +index a9d44cefc..fef4c6ab9 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/DetectorOptions.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.checks.regexp; + ++import static java.util.Objects.requireNonNullElse; ++import static java.util.regex.Pattern.CASE_INSENSITIVE; ++ + import com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter; + import java.util.Optional; + import java.util.regex.Pattern; +@@ -234,8 +237,8 @@ public final class DetectorOptions { + * @return DetectorOptions instance. + */ + public DetectorOptions build() { +- message = Optional.ofNullable(message).orElse(""); +- suppressor = Optional.ofNullable(suppressor).orElse(NeverSuppress.INSTANCE); ++ message = requireNonNullElse(message, ""); ++ suppressor = requireNonNullElse(suppressor, NeverSuppress.INSTANCE); + pattern = Optional.ofNullable(format).map(this::createPattern).orElse(null); + return DetectorOptions.this; + } +@@ -249,7 +252,7 @@ public final class DetectorOptions { + private Pattern createPattern(String formatValue) { + int options = compileFlags; + if (ignoreCase) { +- options |= Pattern.CASE_INSENSITIVE; ++ options |= CASE_INSENSITIVE; + } + return Pattern.compile(formatValue, options); + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java +index d574673b8..9ecaddd5a 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/MultilineDetector.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.checks.regexp; + ++import com.google.common.base.Strings; + import com.puppycrawl.tools.checkstyle.api.FileText; + import com.puppycrawl.tools.checkstyle.api.LineColumn; + import java.util.regex.Matcher; +@@ -65,7 +66,7 @@ class MultilineDetector { + resetState(); + + final String format = options.getFormat(); +- if (format == null || format.isEmpty()) { ++ if (Strings.isNullOrEmpty(format)) { + options.getReporter().log(1, MSG_EMPTY); + } else { + matcher = options.getPattern().matcher(fileText.getFullText()); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java +index 5573725e2..bd5f9d093 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheck.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.checks.regexp; + ++import static java.util.regex.Pattern.MULTILINE; ++ ++import com.google.common.base.Strings; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; +@@ -463,7 +466,7 @@ public class RegexpCheck extends AbstractCheck { + private int errorCount; + + /** Specify the pattern to match against. */ +- private Pattern format = Pattern.compile("^$", Pattern.MULTILINE); ++ private Pattern format = Pattern.compile("^$", MULTILINE); + + /** The matcher. */ + private Matcher matcher; +@@ -524,7 +527,7 @@ public class RegexpCheck extends AbstractCheck { + * @param pattern the new pattern + */ + public final void setFormat(Pattern pattern) { +- format = CommonUtil.createPattern(pattern.pattern(), Pattern.MULTILINE); ++ format = CommonUtil.createPattern(pattern.pattern(), MULTILINE); + } + + @Override +@@ -543,8 +546,8 @@ public class RegexpCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void beginTree(DetailAST rootAST) { + matcher = format.matcher(getFileContents().getText().getFullText()); + matchCount = 0; +@@ -626,7 +629,7 @@ public class RegexpCheck extends AbstractCheck { + private void logMessage(int lineNumber) { + String msg; + +- if (message == null || message.isEmpty()) { ++ if (Strings.isNullOrEmpty(message)) { + msg = format.pattern(); + } else { + msg = message; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java +index e08b62041..dc77e07b2 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheck.java +@@ -19,13 +19,15 @@ + + package com.puppycrawl.tools.checkstyle.checks.regexp; + ++import static java.util.regex.Pattern.DOTALL; ++import static java.util.regex.Pattern.MULTILINE; ++ + import com.puppycrawl.tools.checkstyle.PropertyType; + import com.puppycrawl.tools.checkstyle.StatelessCheck; + import com.puppycrawl.tools.checkstyle.XdocsPropertyType; + import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; + import com.puppycrawl.tools.checkstyle.api.FileText; + import java.io.File; +-import java.util.regex.Pattern; + + /** + * Checks that a specified pattern matches across multiple lines in any file type. +@@ -269,9 +271,9 @@ public class RegexpMultilineCheck extends AbstractFileSetCheck { + final int result; + + if (matchAcrossLines) { +- result = Pattern.DOTALL; ++ result = DOTALL; + } else { +- result = Pattern.MULTILINE; ++ result = MULTILINE; + } + + return result; +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java +index 314e9fb6a..8c82047b6 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheck.java +@@ -227,8 +227,8 @@ public class RegexpSinglelineJavaCheck extends AbstractCheck { + } + + // suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166 +- @SuppressWarnings("deprecation") + @Override ++ @SuppressWarnings("deprecation") + public void beginTree(DetailAST rootAST) { + MatchSuppressor suppressor = null; + if (ignoreComments) { +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java +index 59281d781..4059dbabb 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheck.java +@@ -448,7 +448,7 @@ public class EmptyLineSeparatorCheck extends AbstractCheck { + private void checkCommentInModifiers(DetailAST packageDef) { + final Optional comment = findCommentUnder(packageDef); + if (comment.isPresent()) { +- log(comment.get(), MSG_SHOULD_BE_SEPARATED, comment.get().getText()); ++ log(comment.orElseThrow(), MSG_SHOULD_BE_SEPARATED, comment.orElseThrow().getText()); + } + } + +@@ -496,7 +496,7 @@ public class EmptyLineSeparatorCheck extends AbstractCheck { + // The first child is DOT in case of POSTFIX which have at least 2 children + // First child of DOT again puts us back to normal AST tree which will + // recurse down below from here +- final DetailAST firstChildAfterPostFix = postFixNode.get(); ++ final DetailAST firstChildAfterPostFix = postFixNode.orElseThrow(); + result = getLastElementBeforeEmptyLines(firstChildAfterPostFix, line); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java +index 25dd7690c..26e256506 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheck.java +@@ -453,7 +453,7 @@ public class NoWhitespaceAfterCheck extends AbstractCheck { + typeLastNode = + parent.findFirstToken(TokenTypes.TYPE_ARGUMENTS).findFirstToken(TokenTypes.GENERIC_END); + } else if (objectArrayType.isPresent()) { +- typeLastNode = objectArrayType.get(); ++ typeLastNode = objectArrayType.orElseThrow(); + } else { + typeLastNode = parent.getFirstChild(); + } +@@ -519,7 +519,7 @@ public class NoWhitespaceAfterCheck extends AbstractCheck { + } + // qualified name case + else { +- result = dot.get().getFirstChild().getNextSibling(); ++ result = dot.orElseThrow().getFirstChild().getNextSibling(); + } + return result; + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElement.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElement.java +index 80077d92a..2fc5655e7 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElement.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElement.java +@@ -19,7 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.filters; + +-import java.util.Collections; ++import static java.util.Collections.unmodifiableSet; ++ + import java.util.HashSet; + import java.util.Objects; + import java.util.Set; +@@ -73,7 +74,7 @@ class CsvFilterElement implements IntFilterElement { + * @return the IntFilters of the filter set. + */ + protected Set getFilters() { +- return Collections.unmodifiableSet(filters); ++ return unmodifiableSet(filters); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilter.java +index cfd597ba6..142e7cda3 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilter.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilter.java +@@ -576,7 +576,7 @@ public class SuppressWithPlainTextCommentFilter extends AbstractAutomaticBean im + final Suppression suppression = (Suppression) other; + return Objects.equals(lineNo, suppression.lineNo) + && Objects.equals(columnNo, suppression.columnNo) +- && Objects.equals(suppressionType, suppression.suppressionType) ++ && suppressionType == suppression.suppressionType + && Objects.equals(text, suppression.text) + && Objects.equals(eventSourceRegexp, suppression.eventSourceRegexp) + && Objects.equals(eventMessageRegexp, suppression.eventMessageRegexp) +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +index 87da7c70e..7ef4ed30c 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +@@ -856,7 +856,7 @@ public class SuppressionCommentFilter extends AbstractAutomaticBean implements T + final Tag tag = (Tag) other; + return Objects.equals(line, tag.line) + && Objects.equals(column, tag.column) +- && Objects.equals(tagType, tag.tagType) ++ && tagType == tag.tagType + && Objects.equals(text, tag.text) + && Objects.equals(tagCheckRegexp, tag.tagCheckRegexp) + && Objects.equals(tagMessageRegexp, tag.tagMessageRegexp) +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java +index e2d72558a..f085a41ea 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilter.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.filters; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean; + import com.puppycrawl.tools.checkstyle.api.AuditEvent; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +@@ -26,7 +27,6 @@ import com.puppycrawl.tools.checkstyle.api.ExternalResourceHolder; + import com.puppycrawl.tools.checkstyle.api.Filter; + import com.puppycrawl.tools.checkstyle.api.FilterSet; + import com.puppycrawl.tools.checkstyle.utils.FilterUtil; +-import java.util.Collections; + import java.util.Set; + + /** +@@ -239,6 +239,6 @@ public class SuppressionFilter extends AbstractAutomaticBean + + @Override + public Set getExternalResourceLocations() { +- return Collections.singleton(file); ++ return ImmutableSet.of(file); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilter.java +index bbeab8ef4..a1a2985c1 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilter.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilter.java +@@ -19,13 +19,13 @@ + + package com.puppycrawl.tools.checkstyle.filters; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean; + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; + import com.puppycrawl.tools.checkstyle.TreeWalkerFilter; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.ExternalResourceHolder; + import com.puppycrawl.tools.checkstyle.utils.FilterUtil; +-import java.util.Collections; + import java.util.HashSet; + import java.util.Objects; + import java.util.Set; +@@ -478,7 +478,7 @@ public class SuppressionXpathFilter extends AbstractAutomaticBean + + @Override + public Set getExternalResourceLocations() { +- return Collections.singleton(file); ++ return ImmutableSet.of(file); + } + + @Override +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElement.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElement.java +index 390251b94..4b8995f14 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElement.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElement.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.filters; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++ + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; + import com.puppycrawl.tools.checkstyle.TreeWalkerFilter; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +@@ -28,7 +30,6 @@ import java.util.List; + import java.util.Objects; + import java.util.Optional; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import net.sf.saxon.Configuration; + import net.sf.saxon.om.Item; + import net.sf.saxon.sxpath.XPathDynamicContext; +@@ -190,7 +191,7 @@ public class XpathFilterElement implements TreeWalkerFilter { + } else { + isMatching = false; + final List nodes = +- getItems(event).stream().map(AbstractNode.class::cast).collect(Collectors.toList()); ++ getItems(event).stream().map(AbstractNode.class::cast).collect(toImmutableList()); + for (AbstractNode abstractNode : nodes) { + isMatching = + abstractNode.getTokenType() == event.getTokenType() +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTable.java b/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTable.java +index 57bbb8392..69f79885f 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTable.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/gui/TreeTable.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.gui; + ++import static java.util.stream.Collectors.joining; ++import static java.util.stream.Collectors.toCollection; ++ + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.utils.XpathUtil; + import com.puppycrawl.tools.checkstyle.xpath.ElementNode; +@@ -36,7 +39,6 @@ import java.util.Collection; + import java.util.Deque; + import java.util.EventObject; + import java.util.List; +-import java.util.stream.Collectors; + import javax.swing.AbstractAction; + import javax.swing.Action; + import javax.swing.JTable; +@@ -198,7 +200,7 @@ public final class TreeTable extends JTable { + XpathUtil.getXpathItems(xpath, new RootNode(rootAST)).stream() + .map(ElementNode.class::cast) + .map(ElementNode::getUnderlyingNode) +- .collect(Collectors.toCollection(ArrayDeque::new)); ++ .collect(toCollection(ArrayDeque::new)); + updateTreeTable(xpath, nodes); + } catch (XPathException exception) { + xpathEditor.setText(xpathEditor.getText() + NEWLINE + exception.getMessage()); +@@ -249,7 +251,7 @@ public final class TreeTable extends JTable { + private static String getAllMatchingXpathQueriesText(Deque nodes) { + return nodes.stream() + .map(XpathQueryGenerator::generateXpathQuery) +- .collect(Collectors.joining(NEWLINE, "", NEWLINE)); ++ .collect(joining(NEWLINE, "", NEWLINE)); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraper.java b/src/main/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraper.java +index c862001df..a9a62ac18 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraper.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraper.java +@@ -19,6 +19,10 @@ + + package com.puppycrawl.tools.checkstyle.meta; + ++import static java.util.Collections.unmodifiableMap; ++import static java.util.stream.Collectors.joining; ++ ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.DetailNode; +@@ -28,7 +32,6 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.ArrayDeque; + import java.util.Arrays; +-import java.util.Collections; + import java.util.Deque; + import java.util.HashMap; + import java.util.HashSet; +@@ -39,7 +42,6 @@ import java.util.Optional; + import java.util.Set; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import javax.xml.parsers.ParserConfigurationException; + import javax.xml.transform.TransformerException; + +@@ -98,7 +100,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + * files. + */ + private static final Set PROPERTIES_TO_NOT_WRITE = +- Set.of( ++ ImmutableSet.of( + "null", + "the charset property of the parent Checker module"); +@@ -271,7 +273,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + final Optional propertyNameNode = + getFirstChildOfType(nodeLi, JavadocTokenTypes.JAVADOC_INLINE_TAG, 0); + if (propertyNameNode.isPresent()) { +- final DetailNode propertyNameTag = propertyNameNode.get(); ++ final DetailNode propertyNameTag = propertyNameNode.orElseThrow(); + final String propertyName = getTextFromTag(propertyNameTag); + + final DetailNode propertyType = +@@ -295,7 +297,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + final Optional validationTypeNodeOpt = + getFirstChildOfMatchingText(nodeLi, VALIDATION_TYPE_TAG); + if (validationTypeNodeOpt.isPresent()) { +- final DetailNode validationTypeNode = validationTypeNodeOpt.get(); ++ final DetailNode validationTypeNode = validationTypeNodeOpt.orElseThrow(); + modulePropertyDetails.setValidationType(getTagTextFromProperty(nodeLi, validationTypeNode)); + } + +@@ -327,7 +329,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + nodeLi, JavadocTokenTypes.JAVADOC_INLINE_TAG, propertyMeta.getIndex() + 1); + DetailNode tagNode = null; + if (tagNodeOpt.isPresent()) { +- tagNode = tagNodeOpt.get(); ++ tagNode = tagNodeOpt.orElseThrow(); + } + return getTextFromTag(tagNode); + } +@@ -420,7 +422,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + nodeLi, JavadocTokenTypes.JAVADOC_INLINE_TAG, defaultValueNode.getIndex() + 1); + final String result; + if (propertyDefaultValueTag.isPresent()) { +- result = getTextFromTag(propertyDefaultValueTag.get()); ++ result = getTextFromTag(propertyDefaultValueTag.orElseThrow()); + } else { + final String tokenText = + constructSubTreeText(nodeLi, defaultValueNode.getIndex(), nodeLi.getChildren().length); +@@ -477,7 +479,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + return Arrays.stream(parentNode.getChildren()) + .filter(child -> child.getType() == JavadocTokenTypes.TEXT) + .map(node -> QUOTE_PATTERN.matcher(node.getText().trim()).replaceAll("")) +- .collect(Collectors.joining(" ")); ++ .collect(joining(" ")); + } + + /** +@@ -594,7 +596,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + * @return map containing module details of supplied checks. + */ + public static Map getModuleDetailsStore() { +- return Collections.unmodifiableMap(MODULE_DETAILS_STORE); ++ return unmodifiableMap(MODULE_DETAILS_STORE); + } + + /** Reset the module detail store of any previous information. */ +@@ -617,7 +619,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + return parent.getType() == TokenTypes.CLASS_DEF + && child.getType() == TokenTypes.IDENT; + }); +- return className.isPresent() && getModuleSimpleName().equals(className.get().getText()); ++ return className.isPresent() && getModuleSimpleName().equals(className.orElseThrow().getText()); + } + + /** +@@ -673,7 +675,7 @@ public class JavadocMetadataScraper extends AbstractJavadocCheck { + return getFirstChildOfType(ast, JavadocTokenTypes.TEXT, 0) + .map(DetailNode::getText) + .map(pattern::matcher) +- .map(Matcher::matches) +- .orElse(Boolean.FALSE); ++ .filter(Matcher::matches) ++ .isPresent(); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtil.java +index 5a44465ab..9102c2a1f 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtil.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.meta; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++ + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; + import com.puppycrawl.tools.checkstyle.Checker; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +@@ -35,7 +37,6 @@ import java.nio.file.Path; + import java.nio.file.Paths; + import java.util.ArrayList; + import java.util.List; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + + /** Class which handles all the metadata generation and writing calls. */ +@@ -98,7 +99,7 @@ public final class MetadataGeneratorUtil { + || fileName.endsWith("Check.java") + || fileName.endsWith("Filter.java"); + }) +- .collect(Collectors.toList())); ++ .collect(toImmutableList())); + } + } + root.process(validFiles); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/meta/ModuleDetails.java b/src/main/java/com/puppycrawl/tools/checkstyle/meta/ModuleDetails.java +index c7d9881eb..60eb14a3e 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/meta/ModuleDetails.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/meta/ModuleDetails.java +@@ -19,8 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.meta; + ++import static java.util.Collections.unmodifiableList; ++ + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + + /** Simple POJO class for module details. */ +@@ -125,7 +126,7 @@ public final class ModuleDetails { + * @return property list of module + */ + public List getProperties() { +- return Collections.unmodifiableList(properties); ++ return unmodifiableList(properties); + } + + /** +@@ -152,7 +153,7 @@ public final class ModuleDetails { + * @return violation message keys of module + */ + public List getViolationMessageKeys() { +- return Collections.unmodifiableList(violationMessageKeys); ++ return unmodifiableList(violationMessageKeys); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtil.java +index 73faec583..131e36a58 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtil.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static com.google.common.base.Preconditions.checkArgument; ++ ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.FullIdent; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +@@ -38,7 +41,7 @@ public final class AnnotationUtil { + private static final String FQ_OVERRIDE = "java.lang." + OVERRIDE; + + /** Simple and fully-qualified {@link Override Override} annotation names. */ +- private static final Set OVERRIDE_ANNOTATIONS = Set.of(OVERRIDE, FQ_OVERRIDE); ++ private static final Set OVERRIDE_ANNOTATIONS = ImmutableSet.of(OVERRIDE, FQ_OVERRIDE); + + /** + * Private utility constructor. +@@ -75,9 +78,7 @@ public final class AnnotationUtil { + * @throws IllegalArgumentException when ast is null + */ + public static boolean containsAnnotation(final DetailAST ast) { +- if (ast == null) { +- throw new IllegalArgumentException(THE_AST_IS_NULL); +- } ++ checkArgument(ast != null, THE_AST_IS_NULL); + final DetailAST holder = getAnnotationHolder(ast); + return holder != null && holder.findFirstToken(TokenTypes.ANNOTATION) != null; + } +@@ -95,13 +96,9 @@ public final class AnnotationUtil { + * @throws IllegalArgumentException when ast or annotations are null + */ + public static boolean containsAnnotation(DetailAST ast, Set annotations) { +- if (ast == null) { +- throw new IllegalArgumentException(THE_AST_IS_NULL); +- } ++ checkArgument(ast != null, THE_AST_IS_NULL); + +- if (annotations == null) { +- throw new IllegalArgumentException("annotations cannot be null"); +- } ++ checkArgument(annotations != null, "annotations cannot be null"); + + boolean result = false; + +@@ -160,9 +157,7 @@ public final class AnnotationUtil { + * @throws IllegalArgumentException when ast is null + */ + public static DetailAST getAnnotationHolder(DetailAST ast) { +- if (ast == null) { +- throw new IllegalArgumentException(THE_AST_IS_NULL); +- } ++ checkArgument(ast != null, THE_AST_IS_NULL); + + final DetailAST annotationHolder; + +@@ -192,17 +187,11 @@ public final class AnnotationUtil { + * @throws IllegalArgumentException when ast or annotations are null; when annotation is blank + */ + public static DetailAST getAnnotation(final DetailAST ast, String annotation) { +- if (ast == null) { +- throw new IllegalArgumentException(THE_AST_IS_NULL); +- } ++ checkArgument(ast != null, THE_AST_IS_NULL); + +- if (annotation == null) { +- throw new IllegalArgumentException("the annotation is null"); +- } ++ checkArgument(annotation != null, "the annotation is null"); + +- if (CommonUtil.isBlank(annotation)) { +- throw new IllegalArgumentException("the annotation is empty or spaces"); +- } ++ checkArgument(!CommonUtil.isBlank(annotation), "the annotation is empty or spaces"); + + return findFirstAnnotation( + ast, +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtil.java +index 4122d0b28..51faa5b24 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/CheckUtil.java +@@ -19,6 +19,11 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static java.util.function.Predicate.not; ++import static java.util.stream.Collectors.joining; ++import static java.util.stream.Collectors.toUnmodifiableSet; ++ + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.FullIdent; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +@@ -29,9 +34,7 @@ import java.util.Arrays; + import java.util.Collection; + import java.util.List; + import java.util.Set; +-import java.util.function.Predicate; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + + /** Contains utility methods for the checks. */ +@@ -434,9 +437,7 @@ public final class CheckUtil { + */ + private static AccessModifierOption getAccessModifierFromModifiersTokenDirectly( + DetailAST modifiersToken) { +- if (modifiersToken == null) { +- throw new IllegalArgumentException("expected non-null AST-token with type 'MODIFIERS'"); +- } ++ checkArgument(modifiersToken != null, "expected non-null AST-token with type 'MODIFIERS'"); + + AccessModifierOption accessModifier = AccessModifierOption.PACKAGE; + for (DetailAST token = modifiersToken.getFirstChild(); +@@ -488,8 +489,8 @@ public final class CheckUtil { + public static Set parseClassNames(String... classNames) { + return Arrays.stream(classNames) + .flatMap(className -> Stream.of(className, CommonUtil.baseClassName(className))) +- .filter(Predicate.not(String::isEmpty)) +- .collect(Collectors.toUnmodifiableSet()); ++ .filter(not(String::isEmpty)) ++ .collect(toUnmodifiableSet()); + } + + /** +@@ -510,7 +511,7 @@ public final class CheckUtil { + + return lines.stream() + .map(line -> stripIndentAndTrailingWhitespaceFromLine(line, indent)) +- .collect(Collectors.joining(System.lineSeparator(), suffix, suffix)); ++ .collect(joining(System.lineSeparator(), suffix, suffix)); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtil.java +index 4b84d0cdc..450fb27a9 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/CommonUtil.java +@@ -32,7 +32,6 @@ import java.net.URL; + import java.nio.file.Path; + import java.nio.file.Paths; + import java.util.BitSet; +-import java.util.Objects; + import java.util.regex.Matcher; + import java.util.regex.Pattern; + import java.util.regex.PatternSyntaxException; +@@ -533,7 +532,7 @@ public final class CommonUtil { + * @return true if the arg is blank. + */ + public static boolean isBlank(String value) { +- return Objects.isNull(value) || indexOfNonWhitespace(value) >= value.length(); ++ return value == null || indexOfNonWhitespace(value) >= value.length(); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtil.java +index f891ea05b..83418dedd 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtil.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static com.google.common.base.Preconditions.checkArgument; ++ + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.DetailNode; + import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; +@@ -290,9 +292,7 @@ public final class JavadocUtil { + */ + public static String getTokenName(int id) { + final String name = TOKEN_VALUE_TO_NAME.get(id); +- if (name == null) { +- throw new IllegalArgumentException(UNKNOWN_JAVADOC_TOKEN_ID_EXCEPTION_MESSAGE + id); +- } ++ checkArgument(name != null, "%s%s", UNKNOWN_JAVADOC_TOKEN_ID_EXCEPTION_MESSAGE, id); + return name; + } + +@@ -305,9 +305,7 @@ public final class JavadocUtil { + */ + public static int getTokenId(String name) { + final Integer id = TOKEN_NAME_TO_VALUE.get(name); +- if (id == null) { +- throw new IllegalArgumentException("Unknown javadoc token name. Given name " + name); +- } ++ checkArgument(id != null, "Unknown javadoc token name. Given name %s", name); + return id; + } + +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtil.java +index 5b26eb186..e04619f45 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtil.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; ++ + import com.google.common.reflect.ClassPath; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean; + import com.puppycrawl.tools.checkstyle.TreeWalkerFilter; +@@ -33,7 +35,6 @@ import java.lang.reflect.Constructor; + import java.lang.reflect.Modifier; + import java.util.Collection; + import java.util.Set; +-import java.util.stream.Collectors; + + /** Contains utility methods for module reflection. */ + public final class ModuleReflectionUtil { +@@ -57,7 +58,7 @@ public final class ModuleReflectionUtil { + .flatMap(pkg -> classPath.getTopLevelClasses(pkg).stream()) + .map(ClassPath.ClassInfo::load) + .filter(ModuleReflectionUtil::isCheckstyleModule) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtil.java +index e4e29ffed..6f62d1a5e 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtil.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static java.util.Objects.requireNonNullElseGet; ++ + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.Scope; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +@@ -80,8 +82,8 @@ public final class ScopeUtil { + * @see #getDefaultScope(DetailAST) + */ + public static Scope getScopeFromMods(DetailAST aMods) { +- return Optional.ofNullable(getDeclaredScopeFromMods(aMods)) +- .orElseGet(() -> getDefaultScope(aMods.getParent())); ++ return requireNonNullElseGet( ++ getDeclaredScopeFromMods(aMods), () -> getDefaultScope(aMods.getParent())); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java +index 8cd4bc9d3..26043dafc 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/TokenUtil.java +@@ -19,6 +19,11 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static com.google.common.base.Preconditions.checkArgument; ++import static com.google.common.collect.ImmutableMap.toImmutableMap; ++import static java.util.function.Predicate.not; ++import static java.util.stream.Collectors.toUnmodifiableMap; ++ + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import java.lang.reflect.Field; +@@ -31,7 +36,6 @@ import java.util.Optional; + import java.util.ResourceBundle; + import java.util.function.Consumer; + import java.util.function.Predicate; +-import java.util.stream.Collectors; + import java.util.stream.IntStream; + + /** Contains utility methods for tokens. */ +@@ -90,9 +94,7 @@ public final class TokenUtil { + public static Map nameToValueMapFromPublicIntFields(Class cls) { + return Arrays.stream(cls.getDeclaredFields()) + .filter(fld -> Modifier.isPublic(fld.getModifiers()) && fld.getType() == Integer.TYPE) +- .collect( +- Collectors.toUnmodifiableMap( +- Field::getName, fld -> getIntFromField(fld, fld.getName()))); ++ .collect(toUnmodifiableMap(Field::getName, fld -> getIntFromField(fld, fld.getName()))); + } + + /** +@@ -102,8 +104,7 @@ public final class TokenUtil { + * @return inverted map + */ + public static Map invertMap(Map map) { +- return map.entrySet().stream() +- .collect(Collectors.toMap(Map.Entry::getValue, Map.Entry::getKey)); ++ return map.entrySet().stream().collect(toImmutableMap(Map.Entry::getValue, Map.Entry::getKey)); + } + + /** +@@ -135,9 +136,7 @@ public final class TokenUtil { + */ + public static String getTokenName(int id) { + final String name = TOKEN_VALUE_TO_NAME.get(id); +- if (name == null) { +- throw new IllegalArgumentException(String.format(Locale.ROOT, TOKEN_ID_EXCEPTION_FORMAT, id)); +- } ++ checkArgument(name != null, String.format(Locale.ROOT, TOKEN_ID_EXCEPTION_FORMAT, id)); + return name; + } + +@@ -150,10 +149,7 @@ public final class TokenUtil { + */ + public static int getTokenId(String name) { + final Integer id = TOKEN_NAME_TO_VALUE.get(name); +- if (id == null) { +- throw new IllegalArgumentException( +- String.format(Locale.ROOT, TOKEN_NAME_EXCEPTION_FORMAT, name)); +- } ++ checkArgument(id != null, String.format(Locale.ROOT, TOKEN_NAME_EXCEPTION_FORMAT, name)); + return id; + } + +@@ -165,10 +161,9 @@ public final class TokenUtil { + * @throws IllegalArgumentException when name is unknown + */ + public static String getShortDescription(String name) { +- if (!TOKEN_NAME_TO_VALUE.containsKey(name)) { +- throw new IllegalArgumentException( +- String.format(Locale.ROOT, TOKEN_NAME_EXCEPTION_FORMAT, name)); +- } ++ checkArgument( ++ TOKEN_NAME_TO_VALUE.containsKey(name), ++ String.format(Locale.ROOT, TOKEN_NAME_EXCEPTION_FORMAT, name)); + + final String tokenTypes = "com.puppycrawl.tools.checkstyle.api.tokentypes"; + final ResourceBundle bundle = ResourceBundle.getBundle(tokenTypes, Locale.ROOT); +@@ -333,7 +328,7 @@ public final class TokenUtil { + public static BitSet asBitSet(String... tokens) { + return Arrays.stream(tokens) + .map(String::trim) +- .filter(Predicate.not(String::isEmpty)) ++ .filter(not(String::isEmpty)) + .mapToInt(TokenUtil::getTokenId) + .collect(BitSet::new, BitSet::set, BitSet::or); + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java b/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java +index 6e850e9de..dc43e1ca0 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/utils/XpathUtil.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static java.util.stream.Collectors.joining; ++import static java.util.stream.Collectors.toUnmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.AstTreeStringPrinter; + import com.puppycrawl.tools.checkstyle.JavaParser; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +@@ -34,7 +37,6 @@ import java.util.BitSet; + import java.util.List; + import java.util.Locale; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import net.sf.saxon.Configuration; + import net.sf.saxon.om.Item; + import net.sf.saxon.om.NodeInfo; +@@ -194,7 +196,7 @@ public final class XpathUtil { + return matchingItems.stream() + .map(item -> ((ElementNode) item).getUnderlyingNode()) + .map(AstTreeStringPrinter::printBranch) +- .collect(Collectors.joining(DELIMITER)); ++ .collect(joining(DELIMITER)); + } catch (XPathException ex) { + final String errMsg = + String.format( +@@ -220,6 +222,6 @@ public final class XpathUtil { + final XPathExpression xpathExpression = xpathEvaluator.createExpression(xpath); + final XPathDynamicContext xpathDynamicContext = xpathExpression.createDynamicContext(rootNode); + final List items = xpathExpression.evaluate(xpathDynamicContext); +- return items.stream().map(NodeInfo.class::cast).collect(Collectors.toUnmodifiableList()); ++ return items.stream().map(NodeInfo.class::cast).collect(toUnmodifiableList()); + } + } +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java +index c2119464e..9c774bacf 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractElementNode.java +@@ -19,11 +19,12 @@ + + package com.puppycrawl.tools.checkstyle.xpath; + ++import static java.util.Collections.unmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.xpath.iterators.DescendantIterator; + import com.puppycrawl.tools.checkstyle.xpath.iterators.FollowingIterator; + import com.puppycrawl.tools.checkstyle.xpath.iterators.PrecedingIterator; + import com.puppycrawl.tools.checkstyle.xpath.iterators.ReverseListIterator; +-import java.util.Collections; + import java.util.List; + import java.util.Optional; + import net.sf.saxon.om.AxisInfo; +@@ -306,7 +307,7 @@ public abstract class AbstractElementNode extends AbstractNode { + */ + private List getPrecedingSiblings() { + final List siblings = parent.getChildren(); +- return Collections.unmodifiableList(siblings.subList(0, indexAmongSiblings)); ++ return unmodifiableList(siblings.subList(0, indexAmongSiblings)); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java +index 8bbd5cb75..de450f036 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/AbstractNode.java +@@ -19,7 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.xpath; + +-import java.util.Collections; ++import static java.util.Collections.unmodifiableList; ++ + import java.util.List; + import net.sf.saxon.Configuration; + import net.sf.saxon.event.Receiver; +@@ -91,7 +92,7 @@ public abstract class AbstractNode implements NodeInfo { + if (children == null) { + children = createChildren(); + } +- return Collections.unmodifiableList(children); ++ return unmodifiableList(children); + } + + /** +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGenerator.java b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGenerator.java +index 65b1e65b7..7d1aaac50 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGenerator.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGenerator.java +@@ -19,6 +19,8 @@ + + package com.puppycrawl.tools.checkstyle.xpath; + ++import static com.google.common.collect.ImmutableList.toImmutableList; ++ + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.FileText; +@@ -27,7 +29,6 @@ import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import com.puppycrawl.tools.checkstyle.utils.XpathUtil; + import java.util.ArrayList; + import java.util.List; +-import java.util.stream.Collectors; + + /** + * Generates xpath queries. Xpath queries are generated based on received {@code DetailAst} element, +@@ -140,7 +141,7 @@ public class XpathQueryGenerator { + public List generate() { + return getMatchingAstElements().stream() + .map(XpathQueryGenerator::generateXpathQuery) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + } + + /** +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBeanTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBeanTest.java +index 51432a1cb..7c16ed795 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBeanTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractAutomaticBeanTest.java +@@ -34,9 +34,9 @@ import org.apache.commons.beanutils.ConvertUtilsBean; + import org.apache.commons.beanutils.Converter; + import org.junit.jupiter.api.Test; + +-public class AbstractAutomaticBeanTest { ++final class AbstractAutomaticBeanTest { + @Test +- public void testConfigureNoSuchAttribute() { ++ void configureNoSuchAttribute() { + final TestBean testBean = new TestBean(); + final DefaultConfiguration conf = new DefaultConfiguration("testConf"); + conf.addProperty("NonExistent", "doesn't matter"); +@@ -53,7 +53,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testConfigureNoSuchAttribute2() { ++ void configureNoSuchAttribute2() { + final TestBean testBean = new TestBean(); + final DefaultConfiguration conf = new DefaultConfiguration("testConf"); + conf.addProperty("privateField", "doesn't matter"); +@@ -70,7 +70,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testSetupChildFromBaseClass() throws CheckstyleException { ++ void setupChildFromBaseClass() throws CheckstyleException { + final TestBean testBean = new TestBean(); + testBean.configure(new DefaultConfiguration("bean config")); + testBean.setupChild(null); +@@ -90,7 +90,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testSetupInvalidChildFromBaseClass() { ++ void setupInvalidChildFromBaseClass() { + final TestBean testBean = new TestBean(); + final DefaultConfiguration parentConf = new DefaultConfiguration("parentConf"); + final DefaultConfiguration childConf = new DefaultConfiguration("childConf"); +@@ -111,7 +111,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testContextualizeInvocationTargetException() { ++ void contextualizeInvocationTargetException() { + final TestBean testBean = new TestBean(); + final DefaultContext context = new DefaultContext(); + context.add("exceptionalMethod", 123.0f); +@@ -132,7 +132,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testContextualizeConversionException() { ++ void contextualizeConversionException() { + final TestBean testBean = new TestBean(); + final DefaultContext context = new DefaultContext(); + context.add("val", "some string"); +@@ -153,7 +153,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testTestBean() { ++ void testBean() { + final TestBean testBean = new TestBean(); + testBean.setVal(0); + testBean.setWrong("wrongVal"); +@@ -170,7 +170,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testRegisterIntegralTypes() throws Exception { ++ void registerIntegralTypes() throws Exception { + final ConvertUtilsBeanStub convertUtilsBean = new ConvertUtilsBeanStub(); + TestUtil.invokeStaticMethod( + AbstractAutomaticBean.class, "registerIntegralTypes", convertUtilsBean); +@@ -180,7 +180,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testBeanConverters() throws Exception { ++ void beanConverters() throws Exception { + final ConverterBean bean = new ConverterBean(); + + // methods are not seen as used by reflection +@@ -214,7 +214,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testBeanConvertersUri2() throws Exception { ++ void beanConvertersUri2() throws Exception { + final ConverterBean bean = new ConverterBean(); + final DefaultConfiguration config = new DefaultConfiguration("bean"); + config.addProperty("uri", ""); +@@ -224,7 +224,7 @@ public class AbstractAutomaticBeanTest { + } + + @Test +- public void testBeanConvertersUri3() { ++ void beanConvertersUri3() { + final ConverterBean bean = new ConverterBean(); + final DefaultConfiguration config = new DefaultConfiguration("bean"); + config.addProperty("uri", "BAD"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java +index 510c2d31b..8ee4dcc14 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractModuleTestSupport.java +@@ -19,8 +19,12 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.collect.ImmutableList.toImmutableList; + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.stream.Collectors.toCollection; + ++import com.google.common.collect.ImmutableList; + import com.google.common.collect.Maps; + import com.puppycrawl.tools.checkstyle.LocalizedMessage.Utf8Control; + import com.puppycrawl.tools.checkstyle.api.Configuration; +@@ -47,7 +51,6 @@ import java.util.List; + import java.util.Locale; + import java.util.Map; + import java.util.ResourceBundle; +-import java.util.stream.Collectors; + + public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport { + +@@ -381,7 +384,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport + */ + protected final void execute(Configuration config, String... filenames) throws Exception { + final Checker checker = createChecker(config); +- final List files = Arrays.stream(filenames).map(File::new).collect(Collectors.toList()); ++ final List files = Arrays.stream(filenames).map(File::new).collect(toImmutableList()); + checker.process(files); + checker.destroy(); + } +@@ -402,11 +405,9 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport + actualViolations.stream() + .map(violation -> violation.substring(0, violation.indexOf(':'))) + .map(Integer::valueOf) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + final List expectedViolationLines = +- testInputViolations.stream() +- .map(TestInputViolation::getLineNo) +- .collect(Collectors.toList()); ++ testInputViolations.stream().map(TestInputViolation::getLineNo).collect(toImmutableList()); + assertWithMessage("Violation lines for %s differ.", file) + .that(actualViolationLines) + .isEqualTo(expectedViolationLines); +@@ -429,7 +430,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport + throws Exception { + stream.flush(); + stream.reset(); +- final List files = Collections.singletonList(new File(file)); ++ final List files = ImmutableList.of(new File(file)); + final Checker checker = createChecker(config); + final Map> actualViolations = getActualViolations(checker.process(files)); + checker.destroy(); +@@ -448,8 +449,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport + private Map> getActualViolations(int errorCount) throws IOException { + // process each of the lines + try (ByteArrayInputStream inputStream = new ByteArrayInputStream(stream.toByteArray()); +- LineNumberReader lnr = +- new LineNumberReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { ++ LineNumberReader lnr = new LineNumberReader(new InputStreamReader(inputStream, UTF_8))) { + final Map> actualViolations = new HashMap<>(); + for (String line = lnr.readLine(); + line != null && lnr.getLineNumber() <= errorCount; +@@ -552,7 +552,7 @@ public abstract class AbstractModuleTestSupport extends AbstractPathTestSupport + protected static String[] removeSuppressed( + String[] actualViolations, String... suppressedViolations) { + final List actualViolationsList = +- Arrays.stream(actualViolations).collect(Collectors.toCollection(ArrayList::new)); ++ Arrays.stream(actualViolations).collect(toCollection(ArrayList::new)); + actualViolationsList.removeAll(Arrays.asList(suppressedViolations)); + return actualViolationsList.toArray(CommonUtil.EMPTY_STRING_ARRAY); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java +index fded425fa..f77df3369 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractPathTestSupport.java +@@ -19,12 +19,13 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static java.util.stream.Collectors.joining; ++ + import java.io.File; + import java.io.IOException; + import java.nio.file.Files; + import java.nio.file.Paths; +-import java.util.stream.Collectors; +-import java.util.stream.Stream; ++import java.util.Arrays; + + public abstract class AbstractPathTestSupport { + +@@ -95,7 +96,7 @@ public abstract class AbstractPathTestSupport { + * @return joined strings + */ + public static String addEndOfLine(String... strings) { +- return Stream.of(strings).collect(Collectors.joining(EOL, "", EOL)); ++ return Arrays.stream(strings).collect(joining(EOL, "", EOL)); + } + + /** +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractXmlTestSupport.java b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractXmlTestSupport.java +index fd4a165e4..68b781d4b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/AbstractXmlTestSupport.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/AbstractXmlTestSupport.java +@@ -21,10 +21,10 @@ package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertThat; + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; + import java.io.ByteArrayOutputStream; +-import java.nio.charset.StandardCharsets; + import java.util.Set; + import java.util.function.BiPredicate; + import javax.xml.parsers.ParserConfigurationException; +@@ -43,7 +43,7 @@ public abstract class AbstractXmlTestSupport extends AbstractModuleTestSupport { + */ + protected static Document getOutputStreamXml(ByteArrayOutputStream outputStream) + throws ParserConfigurationException { +- final String xml = outputStream.toString(StandardCharsets.UTF_8); ++ final String xml = outputStream.toString(UTF_8); + + return XmlUtil.getRawXml("audit output", xml, xml); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/AstTreeStringPrinterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/AstTreeStringPrinterTest.java +index 91f422000..1fbdd1caf 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/AstTreeStringPrinterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/AstTreeStringPrinterTest.java +@@ -32,7 +32,7 @@ import java.nio.file.Files; + import java.nio.file.Paths; + import org.junit.jupiter.api.Test; + +-public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { ++final class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,14 +40,14 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(AstTreeStringPrinter.class)) + .isTrue(); + } + + @Test +- public void testParseFileThrowable() throws Exception { ++ void parseFileThrowable() throws Exception { + final File input = new File(getNonCompilablePath("InputAstTreeStringPrinter.java")); + try { + AstTreeStringPrinter.printFileAst(input, JavaParser.Options.WITHOUT_COMMENTS); +@@ -63,7 +63,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testParseFile() throws Exception { ++ void parseFile() throws Exception { + verifyAst( + getPath("ExpectedAstTreeStringPrinter.txt"), + getPath("InputAstTreeStringPrinterComments.java"), +@@ -71,7 +71,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testPrintBranch() throws Exception { ++ void printBranch() throws Exception { + final DetailAST ast = + JavaParser.parseFile( + new File(getPath("InputAstTreeStringPrinterPrintBranch.java")), +@@ -89,7 +89,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testPrintAst() throws Exception { ++ void printAst() throws Exception { + final FileText text = + new FileText( + new File(getPath("InputAstTreeStringPrinterComments.java")).getAbsoluteFile(), +@@ -103,7 +103,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testParseFileWithComments() throws Exception { ++ void parseFileWithComments() throws Exception { + verifyAst( + getPath("ExpectedAstTreeStringPrinterComments.txt"), + getPath("InputAstTreeStringPrinterComments.java"), +@@ -111,35 +111,35 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testParseFileWithJavadoc1() throws Exception { ++ void parseFileWithJavadoc1() throws Exception { + verifyJavaAndJavadocAst( + getPath("ExpectedAstTreeStringPrinterJavadoc.txt"), + getPath("InputAstTreeStringPrinterJavadoc.java")); + } + + @Test +- public void testParseFileWithJavadoc2() throws Exception { ++ void parseFileWithJavadoc2() throws Exception { + verifyJavaAndJavadocAst( + getPath("ExpectedAstTreeStringPrinterJavaAndJavadoc.txt"), + getPath("InputAstTreeStringPrinterJavaAndJavadoc.java")); + } + + @Test +- public void testParseFileWithJavadoc3() throws Exception { ++ void parseFileWithJavadoc3() throws Exception { + verifyJavaAndJavadocAst( + getPath("ExpectedAstTreeStringPrinterAttributesAndMethodsJavadoc.txt"), + getPath("InputAstTreeStringPrinterAttributesAndMethodsJavadoc.java")); + } + + @Test +- public void testJavadocPosition() throws Exception { ++ void javadocPosition() throws Exception { + verifyJavaAndJavadocAst( + getPath("ExpectedAstTreeStringPrinterJavadocPosition.txt"), + getPath("InputAstTreeStringPrinterJavadocPosition.java")); + } + + @Test +- public void testAstTreeBlockComments() throws Exception { ++ void astTreeBlockComments() throws Exception { + verifyAst( + getPath("ExpectedAstTreeStringPrinterFullOfBlockComments.txt"), + getPath("InputAstTreeStringPrinterFullOfBlockComments.java"), +@@ -147,7 +147,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testAstTreeBlockCommentsCarriageReturn() throws Exception { ++ void astTreeBlockCommentsCarriageReturn() throws Exception { + verifyAst( + getPath("ExpectedAstTreeStringPrinterFullOfBlockCommentsCR.txt"), + getPath("InputAstTreeStringPrinterFullOfBlockCommentsCR.java"), +@@ -155,7 +155,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testAstTreeSingleLineComments() throws Exception { ++ void astTreeSingleLineComments() throws Exception { + verifyAst( + getPath("ExpectedAstTreeStringPrinterFullOfSinglelineComments.txt"), + getPath("InputAstTreeStringPrinterFullOfSinglelineComments.java"), +@@ -163,7 +163,7 @@ public class AstTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testTextBlocksEscapesAreOneChar() throws Exception { ++ void textBlocksEscapesAreOneChar() throws Exception { + final String inputFilename = "InputAstTreeStringPrinterTextBlocksEscapesAreOneChar.java"; + final DetailAST ast = + JavaParser.parseFile( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatterTest.java +index e3df0df3e..fa8865c0e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/AuditEventDefaultFormatterTest.java +@@ -27,10 +27,10 @@ import com.puppycrawl.tools.checkstyle.api.Violation; + import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import org.junit.jupiter.api.Test; + +-public class AuditEventDefaultFormatterTest { ++final class AuditEventDefaultFormatterTest { + + @Test +- public void testFormatFullyQualifiedModuleNameContainsCheckSuffix() { ++ void formatFullyQualifiedModuleNameContainsCheckSuffix() { + final Violation violation = + new Violation( + 1, +@@ -53,7 +53,7 @@ public class AuditEventDefaultFormatterTest { + } + + @Test +- public void testFormatFullyQualifiedModuleNameDoesNotContainCheckSuffix() { ++ void formatFullyQualifiedModuleNameDoesNotContainCheckSuffix() { + final Violation violation = + new Violation( + 1, +@@ -76,7 +76,7 @@ public class AuditEventDefaultFormatterTest { + } + + @Test +- public void testFormatModuleWithModuleId() { ++ void formatModuleWithModuleId() { + final Violation violation = + new Violation( + 1, +@@ -97,7 +97,7 @@ public class AuditEventDefaultFormatterTest { + } + + @Test +- public void testCalculateBufferLength() throws Exception { ++ void calculateBufferLength() throws Exception { + final Violation violation = + new Violation( + 1, 1, "messages.properties", "key", null, SeverityLevel.ERROR, null, getClass(), null); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java +index 29155b8ac..906ea0b78 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/CheckerTest.java +@@ -19,12 +19,16 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.collect.ImmutableList.toImmutableList; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.Checker.EXCEPTION_MSG; + import static com.puppycrawl.tools.checkstyle.DefaultLogger.AUDIT_FINISHED_MESSAGE; + import static com.puppycrawl.tools.checkstyle.DefaultLogger.AUDIT_STARTED_MESSAGE; + import static com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck.MSG_KEY_NO_NEWLINE_EOF; ++import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.Collections.unmodifiableList; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; +@@ -69,7 +73,6 @@ import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.HashSet; + import java.util.List; + import java.util.Locale; +@@ -77,7 +80,6 @@ import java.util.Properties; + import java.util.Set; + import java.util.SortedSet; + import java.util.TreeSet; +-import java.util.stream.Collectors; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + +@@ -88,7 +90,7 @@ import org.junit.jupiter.api.io.TempDir; + * @noinspectionreason ClassWithTooManyDependencies - complex tests require a large number of + * imports + */ +-public class CheckerTest extends AbstractModuleTestSupport { ++final class CheckerTest extends AbstractModuleTestSupport { + + @TempDir public File temporaryFolder; + +@@ -112,7 +114,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDestroy() throws Exception { ++ void destroy() throws Exception { + final Checker checker = new Checker(); + final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); + checker.addListener(auditAdapter); +@@ -127,7 +129,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + checker.destroy(); + + final File tempFile = File.createTempFile("junit", null, temporaryFolder); +- checker.process(Collections.singletonList(tempFile)); ++ checker.process(ImmutableList.of(tempFile)); + final SortedSet violations = new TreeSet<>(); + violations.add( + new Violation( +@@ -149,7 +151,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddListener() throws Exception { ++ void addListener() throws Exception { + final Checker checker = new Checker(); + final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); + checker.addListener(auditAdapter); +@@ -205,7 +207,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRemoveListener() throws Exception { ++ void removeListener() throws Exception { + final Checker checker = new Checker(); + final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); + final DebugAuditAdapter aa2 = new DebugAuditAdapter(); +@@ -262,21 +264,21 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddBeforeExecutionFileFilter() throws Exception { ++ void addBeforeExecutionFileFilter() throws Exception { + final Checker checker = new Checker(); + final TestBeforeExecutionFileFilter filter = new TestBeforeExecutionFileFilter(); + + checker.addBeforeExecutionFileFilter(filter); + + filter.resetFilter(); +- checker.process(Collections.singletonList(new File("dummy.java"))); ++ checker.process(ImmutableList.of(new File("dummy.java"))); + assertWithMessage("Checker.acceptFileStarted() doesn't call filter") + .that(filter.wasCalled()) + .isTrue(); + } + + @Test +- public void testRemoveBeforeExecutionFileFilter() throws Exception { ++ void removeBeforeExecutionFileFilter() throws Exception { + final Checker checker = new Checker(); + final TestBeforeExecutionFileFilter filter = new TestBeforeExecutionFileFilter(); + final TestBeforeExecutionFileFilter f2 = new TestBeforeExecutionFileFilter(); +@@ -285,7 +287,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + checker.removeBeforeExecutionFileFilter(filter); + + f2.resetFilter(); +- checker.process(Collections.singletonList(new File("dummy.java"))); ++ checker.process(ImmutableList.of(new File("dummy.java"))); + assertWithMessage("Checker.acceptFileStarted() doesn't call filter") + .that(f2.wasCalled()) + .isTrue(); +@@ -295,7 +297,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddFilter() { ++ void addFilter() { + final Checker checker = new Checker(); + final DebugFilter filter = new DebugFilter(); + +@@ -311,7 +313,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRemoveFilter() { ++ void removeFilter() { + final Checker checker = new Checker(); + final DebugFilter filter = new DebugFilter(); + final DebugFilter f2 = new DebugFilter(); +@@ -332,7 +334,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileExtensions() throws Exception { ++ void fileExtensions() throws Exception { + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); + checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); + checkerConfig.addProperty( +@@ -373,7 +375,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoredFileExtensions() throws Exception { ++ void ignoredFileExtensions() throws Exception { + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); + checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); + final File tempFile = File.createTempFile("junit", null, temporaryFolder); +@@ -408,7 +410,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetters() { ++ void setters() { + // all that is set by reflection, so just make code coverage be happy + final Checker checker = new Checker(); + checker.setBasedir("some"); +@@ -432,7 +434,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoClassLoaderNoModuleFactory() { ++ void noClassLoaderNoModuleFactory() { + final Checker checker = new Checker(); + + try { +@@ -446,7 +448,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoModuleFactory() throws Exception { ++ void noModuleFactory() throws Exception { + final Checker checker = new Checker(); + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + +@@ -460,7 +462,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinishLocalSetupFullyInitialized() throws Exception { ++ void finishLocalSetupFullyInitialized() throws Exception { + final Checker checker = new Checker(); + final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); + checker.setModuleClassLoader(contextClassLoader); +@@ -491,7 +493,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetupChildExceptions() { ++ void setupChildExceptions() { + final Checker checker = new Checker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -509,7 +511,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetupChildInvalidProperty() throws Exception { ++ void setupChildInvalidProperty() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); + checkConfig.addProperty("$$No such property", null); + try { +@@ -528,7 +530,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetupChildListener() throws Exception { ++ void setupChildListener() throws Exception { + final Checker checker = new Checker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -545,7 +547,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDestroyCheckerWithWrongCacheFileNameLength() throws Exception { ++ void destroyCheckerWithWrongCacheFileNameLength() throws Exception { + final Checker checker = new Checker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -567,8 +569,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + + /** It is OK to have long test method name here as it describes the test purpose. */ + @Test +- public void testCacheAndCheckWhichDoesNotImplementExternalResourceHolderInterface() +- throws Exception { ++ void cacheAndCheckWhichDoesNotImplementExternalResourceHolderInterface() throws Exception { + assertWithMessage("ExternalResourceHolder has changed his parent") + .that(ExternalResourceHolder.class.isAssignableFrom(HiddenFieldCheck.class)) + .isFalse(); +@@ -605,7 +606,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithCacheWithNoViolation() throws Exception { ++ void withCacheWithNoViolation() throws Exception { + final Checker checker = new Checker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -646,7 +647,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearExistingCache() throws Exception { ++ void clearExistingCache() throws Exception { + final DefaultConfiguration checkerConfig = createRootConfig(null); + checkerConfig.addProperty("charset", StandardCharsets.UTF_8.name()); + final File cacheFile = File.createTempFile("junit", null, temporaryFolder); +@@ -695,7 +696,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearCache() throws Exception { ++ void clearCache() throws Exception { + final DefaultConfiguration violationCheck = + createModuleConfig(DummyFileSetViolationCheck.class); + final DefaultConfiguration checkerConfig = new DefaultConfiguration("myConfig"); +@@ -708,7 +709,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + checker.configure(checkerConfig); + checker.addListener(getBriefUtLogger()); + +- checker.process(Collections.singletonList(new File("dummy.java"))); ++ checker.process(ImmutableList.of(new File("dummy.java"))); + checker.clearCache(); + // invoke destroy to persist cache + final PropertyCacheFile cache = TestUtil.getInternalState(checker, "cacheFile"); +@@ -723,7 +724,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void setFileExtension() { ++ void setFileExtension() { + final Checker checker = new Checker(); + checker.setFileExtensions(".test1", "test2"); + final String[] actual = TestUtil.getInternalState(checker, "fileExtensions"); +@@ -733,7 +734,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearCacheWhenCacheFileIsNotSet() { ++ void clearCacheWhenCacheFileIsNotSet() { + // The idea of the test is to check that when cache file is not set, + // the invocation of clearCache method does not throw an exception. + final Checker checker = new Checker(); +@@ -752,7 +753,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + * does not require serialization + */ + @Test +- public void testCatchErrorInProcessFilesMethod() throws Exception { ++ void catchErrorInProcessFilesMethod() throws Exception { + // Assume that I/O error is happened when we try to invoke 'lastModified()' method. + final String errorMessage = + "Java Virtual Machine is broken" +@@ -808,7 +809,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + * does not require serialization + */ + @Test +- public void testCatchErrorWithNoFileName() throws Exception { ++ void catchErrorWithNoFileName() throws Exception { + // Assume that I/O error is happened when we try to invoke 'lastModified()' method. + final String errorMessage = + "Java Virtual Machine is broken" +@@ -866,8 +867,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + + /** It is OK to have long test method name here as it describes the test purpose. */ + @Test +- public void testCacheAndFilterWhichDoesNotImplementExternalResourceHolderInterface() +- throws Exception { ++ void cacheAndFilterWhichDoesNotImplementExternalResourceHolderInterface() throws Exception { + assertWithMessage("ExternalResourceHolder has changed its parent") + .that(ExternalResourceHolder.class.isAssignableFrom(DummyFilter.class)) + .isFalse(); +@@ -913,8 +913,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + /** It is OK to have long test method name here as it describes the test purpose. */ + // -@cs[ExecutableStatementCount] This test needs to verify many things. + @Test +- public void testCacheAndCheckWhichAddsNewResourceLocationButKeepsSameCheckerInstance() +- throws Exception { ++ void cacheAndCheckWhichAddsNewResourceLocationButKeepsSameCheckerInstance() throws Exception { + // Use case (https://github.com/checkstyle/checkstyle/pull/3092#issuecomment-218162436): + // Imagine that cache exists in a file. New version of Checkstyle appear. + // New release contains update to a some check to have additional external resource. +@@ -995,7 +994,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearLazyLoadCacheInDetailAST() throws Exception { ++ void clearLazyLoadCacheInDetailAST() throws Exception { + final DefaultConfiguration checkConfig1 = + createModuleConfig(CheckWhichDoesNotRequireCommentNodes.class); + final DefaultConfiguration checkConfig2 = +@@ -1014,7 +1013,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheOnViolationSuppression() throws Exception { ++ void cacheOnViolationSuppression() throws Exception { + final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + final DefaultConfiguration violationCheck = + createModuleConfig(DummyFileSetViolationCheck.class); +@@ -1043,7 +1042,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHaltOnException() throws Exception { ++ void haltOnException() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); + final String filePath = getPath("InputChecker.java"); + try { +@@ -1057,7 +1056,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExceptionWithCache() throws Exception { ++ void exceptionWithCache() throws Exception { + final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + + final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); +@@ -1074,7 +1073,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + + final String filePath = getPath("InputChecker.java"); + try { +- checker.process(Collections.singletonList(new File(filePath))); ++ checker.process(ImmutableList.of(new File(filePath))); + assertWithMessage("Exception is expected").fail(); + } catch (CheckstyleException ex) { + assertWithMessage("Error message is not expected") +@@ -1102,7 +1101,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + * does not require serialization + */ + @Test +- public void testCatchErrorWithCache() throws Exception { ++ void catchErrorWithCache() throws Exception { + final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); +@@ -1178,7 +1177,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + * does not require serialization + */ + @Test +- public void testCatchErrorWithCacheWithNoFileName() throws Exception { ++ void catchErrorWithCacheWithNoFileName() throws Exception { + final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); +@@ -1249,7 +1248,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + * does not require serialization + */ + @Test +- public void testExceptionWithNoFileName() { ++ void exceptionWithNoFileName() { + final String errorMessage = "Security Exception"; + final RuntimeException expectedError = new SecurityException(errorMessage); + +@@ -1297,7 +1296,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + * does not require serialization + */ + @Test +- public void testExceptionWithCacheAndNoFileName() throws Exception { ++ void exceptionWithCacheAndNoFileName() throws Exception { + final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + + final DefaultConfiguration checkerConfig = new DefaultConfiguration("configuration"); +@@ -1356,7 +1355,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHaltOnExceptionOff() throws Exception { ++ void haltOnExceptionOff() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(CheckWhichThrowsError.class); + + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); +@@ -1376,7 +1375,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTabViolationDefault() throws Exception { ++ void tabViolationDefault() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(VerifyPositionAfterTabFileSet.class); + final String[] expected = { +@@ -1386,7 +1385,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTabViolation() throws Exception { ++ void tabViolation() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(VerifyPositionAfterTabFileSet.class); + final DefaultConfiguration checkerConfig = createRootConfig(checkConfig); +@@ -1398,11 +1397,11 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckerProcessCallAllNeededMethodsOfFileSets() throws Exception { ++ void checkerProcessCallAllNeededMethodsOfFileSets() throws Exception { + final DummyFileSet fileSet = new DummyFileSet(); + final Checker checker = new Checker(); + checker.addFileSetCheck(fileSet); +- checker.process(Collections.singletonList(new File("dummy.java"))); ++ checker.process(ImmutableList.of(new File("dummy.java"))); + final List expected = Arrays.asList("beginProcessing", "finishProcessing", "destroy"); + assertWithMessage("Method calls were not expected") + .that(fileSet.getMethodCalls()) +@@ -1410,7 +1409,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetFileSetCheckSetsMessageDispatcher() { ++ void setFileSetCheckSetsMessageDispatcher() { + final DummyFileSet fileSet = new DummyFileSet(); + final Checker checker = new Checker(); + checker.addFileSetCheck(fileSet); +@@ -1420,7 +1419,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddAuditListenerAsChild() throws Exception { ++ void addAuditListenerAsChild() throws Exception { + final Checker checker = new Checker(); + final DebugAuditAdapter auditAdapter = new DebugAuditAdapter(); + final PackageObjectFactory factory = +@@ -1437,14 +1436,14 @@ public class CheckerTest extends AbstractModuleTestSupport { + checker.setModuleFactory(factory); + checker.setupChild(createModuleConfig(DebugAuditAdapter.class)); + // Let's try fire some events +- checker.process(Collections.singletonList(new File("dummy.java"))); ++ checker.process(ImmutableList.of(new File("dummy.java"))); + assertWithMessage("Checker.fireAuditStarted() doesn't call listener") + .that(auditAdapter.wasCalled()) + .isTrue(); + } + + @Test +- public void testAddBeforeExecutionFileFilterAsChild() throws Exception { ++ void addBeforeExecutionFileFilterAsChild() throws Exception { + final Checker checker = new Checker(); + final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); + final PackageObjectFactory factory = +@@ -1460,14 +1459,14 @@ public class CheckerTest extends AbstractModuleTestSupport { + }; + checker.setModuleFactory(factory); + checker.setupChild(createModuleConfig(TestBeforeExecutionFileFilter.class)); +- checker.process(Collections.singletonList(new File("dummy.java"))); ++ checker.process(ImmutableList.of(new File("dummy.java"))); + assertWithMessage("Checker.acceptFileStarted() doesn't call listener") + .that(fileFilter.wasCalled()) + .isTrue(); + } + + @Test +- public void testFileSetCheckInitWhenAddedAsChild() throws Exception { ++ void fileSetCheckInitWhenAddedAsChild() throws Exception { + final Checker checker = new Checker(); + final DummyFileSet fileSet = new DummyFileSet(); + final PackageObjectFactory factory = +@@ -1489,7 +1488,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + + // -@cs[CheckstyleTestMakeup] must use raw class to directly initialize DefaultLogger + @Test +- public void testDefaultLoggerClosesItStreams() throws Exception { ++ void defaultLoggerClosesItStreams() throws Exception { + final Checker checker = new Checker(); + try (CloseAndFlushTestByteArrayOutputStream testInfoOutputStream = + new CloseAndFlushTestByteArrayOutputStream(); +@@ -1525,7 +1524,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + + // -@cs[CheckstyleTestMakeup] must use raw class to directly initialize DefaultLogger + @Test +- public void testXmlLoggerClosesItStreams() throws Exception { ++ void xmlLoggerClosesItStreams() throws Exception { + final Checker checker = new Checker(); + try (CloseAndFlushTestByteArrayOutputStream testInfoOutputStream = + new CloseAndFlushTestByteArrayOutputStream()) { +@@ -1547,7 +1546,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDuplicatedModule() throws Exception { ++ void duplicatedModule() throws Exception { + // we need to test a module with two instances, one with id and the other not + final DefaultConfiguration moduleConfig1 = createModuleConfig(NewlineAtEndOfFileCheck.class); + final DefaultConfiguration moduleConfig2 = createModuleConfig(NewlineAtEndOfFileCheck.class); +@@ -1579,10 +1578,9 @@ public class CheckerTest extends AbstractModuleTestSupport { + + // super.verify does not work here, for we change the logger + out.flush(); +- final int errs = checker.process(Collections.singletonList(new File(path))); ++ final int errs = checker.process(ImmutableList.of(new File(path))); + try (ByteArrayInputStream inputStream = new ByteArrayInputStream(out.toByteArray()); +- LineNumberReader lnr = +- new LineNumberReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { ++ LineNumberReader lnr = new LineNumberReader(new InputStreamReader(inputStream, UTF_8))) { + // we need to ignore the unrelated lines + final List actual = + lnr.lines() +@@ -1590,7 +1588,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + .filter(line -> !getCheckMessage(AUDIT_FINISHED_MESSAGE).equals(line)) + .limit(expected.length) + .sorted() +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + Arrays.sort(expected); + + for (int i = 0; i < expected.length; i++) { +@@ -1607,7 +1605,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCachedFile() throws Exception { ++ void cachedFile() throws Exception { + final Checker checker = createChecker(createModuleConfig(TranslationCheck.class)); + final OutputStream infoStream = new ByteArrayOutputStream(); + final OutputStream errorStream = new ByteArrayOutputStream(); +@@ -1620,7 +1618,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + checker.setCacheFile(cacheFile.getAbsolutePath()); + + final File testFile = File.createTempFile("testFile", ".java", temporaryFolder); +- final List files = List.of(testFile, testFile); ++ final List files = ImmutableList.of(testFile, testFile); + checker.process(files); + + assertWithMessage("Cached file should not be processed twice") +@@ -1897,7 +1895,7 @@ public class CheckerTest extends AbstractModuleTestSupport { + } + + public List getMethodCalls() { +- return Collections.unmodifiableList(methodCalls); ++ return unmodifiableList(methodCalls); + } + + public boolean isInitCalled() { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java +index 50a0625c9..37c392fd8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/ConfigurationLoaderTest.java +@@ -42,7 +42,7 @@ import org.xml.sax.InputSource; + import org.xml.sax.SAXException; + + /** Unit test for ConfigurationLoader. */ +-public class ConfigurationLoaderTest extends AbstractPathTestSupport { ++final class ConfigurationLoaderTest extends AbstractPathTestSupport { + + @Override + protected String getPackageLocation() { +@@ -72,7 +72,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testResourceLoadConfiguration() throws Exception { ++ void resourceLoadConfiguration() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -90,7 +90,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testResourceLoadConfigurationWithMultiThreadConfiguration() throws Exception { ++ void resourceLoadConfigurationWithMultiThreadConfiguration() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -110,7 +110,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testResourceLoadConfigurationWithSingleThreadConfiguration() throws Exception { ++ void resourceLoadConfigurationWithSingleThreadConfiguration() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -131,14 +131,14 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testEmptyConfiguration() throws Exception { ++ void emptyConfiguration() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) loadConfiguration("InputConfigurationLoaderEmpty.xml"); + verifyConfigNode(config, "Checker", 0, new Properties()); + } + + @Test +- public void testEmptyModuleResolver() throws Exception { ++ void emptyModuleResolver() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) + loadConfiguration("InputConfigurationLoaderEmpty.xml", new Properties()); +@@ -146,7 +146,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testMissingPropertyName() throws Exception { ++ void missingPropertyName() throws Exception { + try { + loadConfiguration("InputConfigurationLoaderMissingPropertyName.xml"); + assertWithMessage("missing property name").fail(); +@@ -164,7 +164,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testMissingPropertyNameInMethodWithBooleanParameter() throws Exception { ++ void missingPropertyNameInMethodWithBooleanParameter() throws Exception { + try { + final String fName = getPath("InputConfigurationLoaderMissingPropertyName.xml"); + ConfigurationLoader.loadConfiguration( +@@ -185,7 +185,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testMissingPropertyValue() throws Exception { ++ void missingPropertyValue() throws Exception { + try { + loadConfiguration("InputConfigurationLoaderMissingPropertyValue.xml"); + assertWithMessage("missing property value").fail(); +@@ -203,7 +203,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testMissingConfigName() throws Exception { ++ void missingConfigName() throws Exception { + try { + loadConfiguration("InputConfigurationLoaderMissingConfigName.xml"); + assertWithMessage("missing module name").fail(); +@@ -221,7 +221,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testMissingConfigParent() throws Exception { ++ void missingConfigParent() throws Exception { + try { + loadConfiguration("InputConfigurationLoaderMissingConfigParent.xml"); + assertWithMessage("missing module parent").fail(); +@@ -239,7 +239,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testCheckstyleChecks() throws Exception { ++ void checkstyleChecks() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -277,7 +277,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testCustomMessages() throws Exception { ++ void customMessages() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -314,7 +314,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReplacePropertiesNoReplace() throws Exception { ++ void replacePropertiesNoReplace() throws Exception { + final String[] testValues = { + "", "a", "$a", "{a", "{a}", "a}", "$a}", "$", "a$b", + }; +@@ -329,7 +329,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReplacePropertiesSyntaxError() throws Exception { ++ void replacePropertiesSyntaxError() throws Exception { + final Properties props = initProperties(); + try { + final String value = +@@ -346,7 +346,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReplacePropertiesMissingProperty() throws Exception { ++ void replacePropertiesMissingProperty() throws Exception { + final Properties props = initProperties(); + try { + final String value = +@@ -364,7 +364,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReplacePropertiesReplace() throws Exception { ++ void replacePropertiesReplace() throws Exception { + final String[][] testValues = { + {"${a}", "A"}, + {"x${a}", "xA"}, +@@ -397,7 +397,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testExternalEntity() throws Exception { ++ void externalEntity() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -414,7 +414,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testExternalEntitySubdirectory() throws Exception { ++ void externalEntitySubdirectory() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -431,7 +431,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testExternalEntityFromUri() throws Exception { ++ void externalEntityFromUri() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + +@@ -450,7 +450,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testIncorrectTag() throws Exception { ++ void incorrectTag() throws Exception { + final Class aClassParent = ConfigurationLoader.class; + final Constructor ctorParent = + aClassParent.getDeclaredConstructor( +@@ -479,7 +479,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testNonExistentPropertyName() throws Exception { ++ void nonExistentPropertyName() throws Exception { + try { + loadConfiguration("InputConfigurationLoaderNonexistentProperty.xml"); + assertWithMessage("exception in expected").fail(); +@@ -503,7 +503,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testConfigWithIgnore() throws Exception { ++ void configWithIgnore() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) + ConfigurationLoader.loadConfiguration( +@@ -517,7 +517,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testConfigWithIgnoreUsingInputSource() throws Exception { ++ void configWithIgnoreUsingInputSource() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) + ConfigurationLoader.loadConfiguration( +@@ -534,7 +534,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testConfigCheckerWithIgnore() throws Exception { ++ void configCheckerWithIgnore() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) + ConfigurationLoader.loadConfiguration( +@@ -547,7 +547,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoadConfigurationWrongUrl() { ++ void loadConfigurationWrongUrl() { + try { + ConfigurationLoader.loadConfiguration( + ";InputConfigurationLoaderModuleIgnoreSeverity.xml", +@@ -563,7 +563,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoadConfigurationDeprecated() throws Exception { ++ void loadConfigurationDeprecated() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) + ConfigurationLoader.loadConfiguration( +@@ -579,7 +579,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReplacePropertiesDefault() throws Exception { ++ void replacePropertiesDefault() throws Exception { + final Properties props = new Properties(); + final String defaultValue = "defaultValue"; + +@@ -592,7 +592,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoadConfigurationFromClassPath() throws Exception { ++ void loadConfigurationFromClassPath() throws Exception { + final DefaultConfiguration config = + (DefaultConfiguration) + ConfigurationLoader.loadConfiguration( +@@ -606,7 +606,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testParsePropertyString() throws Exception { ++ void parsePropertyString() throws Exception { + final List propertyRefs = new ArrayList<>(); + final List fragments = new ArrayList<>(); + +@@ -616,7 +616,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testConstructors() throws Exception { ++ void constructors() throws Exception { + final Properties props = new Properties(); + props.setProperty("checkstyle.basedir", "basedir"); + final String fName = getPath("InputConfigurationLoaderChecks.xml"); +@@ -641,7 +641,7 @@ public class ConfigurationLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testConfigWithIgnoreExceptionalAttributes() { ++ void configWithIgnoreExceptionalAttributes() { + try (MockedConstruction mocked = + mockConstruction( + DefaultConfiguration.class, +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java +index e4cd9ca6c..802a68865 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/DefaultConfigurationTest.java +@@ -26,10 +26,10 @@ import java.util.Map; + import java.util.TreeMap; + import org.junit.jupiter.api.Test; + +-public class DefaultConfigurationTest { ++final class DefaultConfigurationTest { + + @Test +- public void testGetPropertyNames() { ++ void getPropertyNames() { + final DefaultConfiguration config = new DefaultConfiguration("MyConfig"); + config.addProperty("property", "value"); + final String[] actual = config.getPropertyNames(); +@@ -38,7 +38,7 @@ public class DefaultConfigurationTest { + } + + @Test +- public void testAddPropertyAndGetProperty() throws CheckstyleException { ++ void addPropertyAndGetProperty() throws CheckstyleException { + final DefaultConfiguration config = new DefaultConfiguration("MyConfig"); + config.addProperty("property", "first"); + assertWithMessage("Invalid property value") +@@ -56,7 +56,7 @@ public class DefaultConfigurationTest { + */ + @Deprecated(since = "10.2") + @Test +- public void testDeprecatedAttributeMethods() throws CheckstyleException { ++ void deprecatedAttributeMethods() throws CheckstyleException { + final DefaultConfiguration config = new DefaultConfiguration("MyConfig"); + config.addAttribute("attribute", "first"); + final String[] actual = config.getAttributeNames(); +@@ -72,13 +72,13 @@ public class DefaultConfigurationTest { + } + + @Test +- public void testGetName() { ++ void getName() { + final DefaultConfiguration config = new DefaultConfiguration("MyConfig"); + assertWithMessage("Invalid configuration name").that(config.getName()).isEqualTo("MyConfig"); + } + + @Test +- public void testRemoveChild() { ++ void removeChild() { + final DefaultConfiguration config = new DefaultConfiguration("MyConfig"); + final DefaultConfiguration configChild = new DefaultConfiguration("childConfig"); + assertWithMessage("Invalid children count").that(config.getChildren().length).isEqualTo(0); +@@ -89,7 +89,7 @@ public class DefaultConfigurationTest { + } + + @Test +- public void testAddMessageAndGetMessages() { ++ void addMessageAndGetMessages() { + final DefaultConfiguration config = new DefaultConfiguration("MyConfig"); + config.addMessage("key", "value"); + final Map expected = new TreeMap<>(); +@@ -98,7 +98,7 @@ public class DefaultConfigurationTest { + } + + @Test +- public void testExceptionForNonExistentProperty() { ++ void exceptionForNonExistentProperty() { + final String name = "MyConfig"; + final DefaultConfiguration config = new DefaultConfiguration(name); + final String propertyName = "NonExistent#$%"; +@@ -113,7 +113,7 @@ public class DefaultConfigurationTest { + } + + @Test +- public void testDefaultMultiThreadConfiguration() { ++ void defaultMultiThreadConfiguration() { + final String name = "MyConfig"; + final DefaultConfiguration config = new DefaultConfiguration(name); + final ThreadModeSettings singleThreadMode = ThreadModeSettings.SINGLE_THREAD_MODE_INSTANCE; +@@ -123,7 +123,7 @@ public class DefaultConfigurationTest { + } + + @Test +- public void testMultiThreadConfiguration() { ++ void multiThreadConfiguration() { + final String name = "MyConfig"; + final ThreadModeSettings multiThreadMode = new ThreadModeSettings(4, 2); + final DefaultConfiguration config = new DefaultConfiguration(name, multiThreadMode); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java +index 346e0eedc..11959cb8e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/DefaultLoggerTest.java +@@ -20,6 +20,7 @@ + package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + import static org.junit.jupiter.api.Assertions.assertThrows; + import static org.junit.jupiter.api.Assumptions.assumeFalse; + +@@ -32,7 +33,6 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import java.io.ByteArrayOutputStream; + import java.io.IOException; + import java.io.OutputStream; +-import java.nio.charset.StandardCharsets; + import java.text.MessageFormat; + import java.util.Arrays; + import java.util.Locale; +@@ -40,17 +40,17 @@ import java.util.ResourceBundle; + import org.junit.jupiter.api.AfterEach; + import org.junit.jupiter.api.Test; + +-public class DefaultLoggerTest { ++final class DefaultLoggerTest { + + private static final Locale DEFAULT_LOCALE = Locale.getDefault(); + + @AfterEach +- public void tearDown() { ++ void tearDown() { + ResourceBundle.clearCache(); + } + + @Test +- public void testCtor() { ++ void ctor() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final ByteArrayOutputStream errorStream = new ByteArrayOutputStream(); + final DefaultLogger dl = +@@ -58,7 +58,7 @@ public class DefaultLoggerTest { + infoStream, OutputStreamOptions.CLOSE, errorStream, OutputStreamOptions.CLOSE); + dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss")); + dl.auditFinished(new AuditEvent(6000, "myfile")); +- final String output = errorStream.toString(StandardCharsets.UTF_8); ++ final String output = errorStream.toString(UTF_8); + final LocalizedMessage addExceptionMessage = getAddExceptionMessageClass("myfile"); + final String message = addExceptionMessage.getMessage(); + assertWithMessage("Invalid exception").that(output).contains(message); +@@ -69,7 +69,7 @@ public class DefaultLoggerTest { + + /** We keep this test for 100% coverage. Until #12873. */ + @Test +- public void testCtorWithTwoParameters() { ++ void ctorWithTwoParameters() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final DefaultLogger dl = new DefaultLogger(infoStream, OutputStreamOptions.CLOSE); + dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss")); +@@ -82,7 +82,7 @@ public class DefaultLoggerTest { + + /** We keep this test for 100% coverage. Until #12873. */ + @Test +- public void testCtorWithTwoParametersCloseStreamOptions() { ++ void ctorWithTwoParametersCloseStreamOptions() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final DefaultLogger dl = new DefaultLogger(infoStream, AutomaticBean.OutputStreamOptions.CLOSE); + final boolean closeInfo = TestUtil.getInternalState(dl, "closeInfo"); +@@ -92,7 +92,7 @@ public class DefaultLoggerTest { + + /** We keep this test for 100% coverage. Until #12873. */ + @Test +- public void testCtorWithTwoParametersNoneStreamOptions() { ++ void ctorWithTwoParametersNoneStreamOptions() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final DefaultLogger dl = new DefaultLogger(infoStream, AutomaticBean.OutputStreamOptions.NONE); + final boolean closeInfo = TestUtil.getInternalState(dl, "closeInfo"); +@@ -101,7 +101,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testCtorWithNullParameter() { ++ void ctorWithNullParameter() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final DefaultLogger dl = new DefaultLogger(infoStream, OutputStreamOptions.CLOSE); + dl.addException(new AuditEvent(5000), new IllegalStateException("upsss")); +@@ -113,7 +113,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testNewCtorWithTwoParameters() { ++ void newCtorWithTwoParameters() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final DefaultLogger dl = new DefaultLogger(infoStream, OutputStreamOptions.NONE); + dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss")); +@@ -124,7 +124,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testNullInfoStreamOptions() { ++ void nullInfoStreamOptions() { + final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + final IllegalArgumentException ex = + assertThrows( +@@ -138,7 +138,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testNullErrorStreamOptions() { ++ void nullErrorStreamOptions() { + final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + final IllegalArgumentException ex = + assertThrows( +@@ -158,7 +158,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testAddError() { ++ void addError() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final OutputStream errorStream = new ByteArrayOutputStream(); + final String auditStartMessage = getAuditStartMessage(); +@@ -188,7 +188,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testAddErrorModuleId() { ++ void addErrorModuleId() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final OutputStream errorStream = new ByteArrayOutputStream(); + final String auditFinishMessage = getAuditFinishMessage(); +@@ -217,7 +217,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testAddErrorIgnoreSeverityLevel() { ++ void addErrorIgnoreSeverityLevel() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final OutputStream errorStream = new ByteArrayOutputStream(); + final DefaultLogger defaultLogger = +@@ -235,7 +235,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testFinishLocalSetup() { ++ void finishLocalSetup() { + final OutputStream infoStream = new ByteArrayOutputStream(); + final DefaultLogger dl = new DefaultLogger(infoStream, OutputStreamOptions.CLOSE); + dl.finishLocalSetup(); +@@ -246,7 +246,7 @@ public class DefaultLoggerTest { + + /** Verifies that the language specified with the system property {@code user.language} exists. */ + @Test +- public void testLanguageIsValid() { ++ void languageIsValid() { + final String language = DEFAULT_LOCALE.getLanguage(); + assumeFalse(language.isEmpty(), "Locale not set"); + assertWithMessage("Invalid language") +@@ -256,7 +256,7 @@ public class DefaultLoggerTest { + + /** Verifies that the country specified with the system property {@code user.country} exists. */ + @Test +- public void testCountryIsValid() { ++ void countryIsValid() { + final String country = DEFAULT_LOCALE.getCountry(); + assumeFalse(country.isEmpty(), "Locale not set"); + assertWithMessage("Invalid country") +@@ -265,7 +265,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testNewCtor() throws Exception { ++ void newCtor() throws Exception { + final ResourceBundle bundle = + ResourceBundle.getBundle(Definitions.CHECKSTYLE_BUNDLE, Locale.ROOT); + final String auditStartedMessage = bundle.getString(DefaultLogger.AUDIT_STARTED_MESSAGE); +@@ -284,8 +284,8 @@ public class DefaultLoggerTest { + dl.auditStarted(null); + dl.addException(new AuditEvent(5000, "myfile"), new IllegalStateException("upsss")); + dl.auditFinished(new AuditEvent(6000, "myfile")); +- infoOutput = infoStream.toString(StandardCharsets.UTF_8); +- errorOutput = errorStream.toString(StandardCharsets.UTF_8); ++ infoOutput = infoStream.toString(UTF_8); ++ errorOutput = errorStream.toString(UTF_8); + + assertWithMessage("Info stream should be closed") + .that(infoStream.closedCount) +@@ -310,7 +310,7 @@ public class DefaultLoggerTest { + } + + @Test +- public void testStreamsNotClosedByLogger() throws IOException { ++ void streamsNotClosedByLogger() throws IOException { + try (MockByteArrayOutputStream infoStream = new MockByteArrayOutputStream(); + MockByteArrayOutputStream errorStream = new MockByteArrayOutputStream()) { + final DefaultLogger defaultLogger = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java +index 8685bbfce..57e6e8bda 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/DefinitionsTest.java +@@ -24,10 +24,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsCla + + import org.junit.jupiter.api.Test; + +-public class DefinitionsTest { ++final class DefinitionsTest { + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(Definitions.class)) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java +index 64eb141d2..8c393fb81 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/DetailAstImplTest.java +@@ -20,6 +20,7 @@ + package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +@@ -29,7 +30,6 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import java.io.Writer; + import java.lang.reflect.Method; +-import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.text.MessageFormat; + import java.util.ArrayList; +@@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + + /** TestCase to check DetailAST. */ +-public class DetailAstImplTest extends AbstractModuleTestSupport { ++final class DetailAstImplTest extends AbstractModuleTestSupport { + + // Ignores file which are not meant to have root node intentionally. + public static final Set NO_ROOT_FILES = +@@ -75,7 +75,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInitialize() { ++ void initialize() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setText("test"); + ast.setType(1); +@@ -95,7 +95,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInitializeToken() { ++ void initializeToken() { + final CommonToken token = new CommonToken(1); + token.setText("test"); + token.setLine(2); +@@ -111,7 +111,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetChildCount() throws Exception { ++ void getChildCount() throws Exception { + final DetailAstImpl root = new DetailAstImpl(); + final DetailAstImpl firstLevelA = new DetailAstImpl(); + final DetailAstImpl firstLevelB = new DetailAstImpl(); +@@ -147,7 +147,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHasChildren() { ++ void hasChildren() { + final DetailAstImpl root = new DetailAstImpl(); + final DetailAstImpl child = new DetailAstImpl(); + root.setFirstChild(child); +@@ -157,7 +157,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetChildCountType() throws Exception { ++ void getChildCountType() throws Exception { + final DetailAstImpl root = new DetailAstImpl(); + final DetailAstImpl firstLevelA = new DetailAstImpl(); + final DetailAstImpl firstLevelB = new DetailAstImpl(); +@@ -186,7 +186,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetSiblingNull() throws Exception { ++ void setSiblingNull() throws Exception { + final DetailAstImpl root = new DetailAstImpl(); + final DetailAstImpl firstLevelA = new DetailAstImpl(); + +@@ -202,7 +202,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddPreviousSibling() { ++ void addPreviousSibling() { + final DetailAST previousSibling = new DetailAstImpl(); + final DetailAstImpl instance = new DetailAstImpl(); + final DetailAstImpl parent = new DetailAstImpl(); +@@ -233,7 +233,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddPreviousSiblingNullParent() { ++ void addPreviousSiblingNullParent() { + final DetailAstImpl child = new DetailAstImpl(); + final DetailAST newSibling = new DetailAstImpl(); + +@@ -244,7 +244,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInsertSiblingBetween() throws Exception { ++ void insertSiblingBetween() throws Exception { + final DetailAstImpl root = new DetailAstImpl(); + final DetailAstImpl firstLevelA = new DetailAstImpl(); + final DetailAST firstLevelB = new DetailAstImpl(); +@@ -274,7 +274,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBranchContains() { ++ void branchContains() { + final DetailAstImpl root = createToken(null, TokenTypes.CLASS_DEF); + final DetailAstImpl modifiers = createToken(root, TokenTypes.MODIFIERS); + createToken(modifiers, TokenTypes.LITERAL_PUBLIC); +@@ -295,7 +295,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearBranchTokenTypes() throws Exception { ++ void clearBranchTokenTypes() throws Exception { + final DetailAstImpl parent = new DetailAstImpl(); + final DetailAstImpl child = new DetailAstImpl(); + parent.setFirstChild(child); +@@ -331,7 +331,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheBranchTokenTypes() { ++ void cacheBranchTokenTypes() { + final DetailAST root = new DetailAstImpl(); + final BitSet bitSet = new BitSet(); + bitSet.set(999); +@@ -341,7 +341,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearChildCountCache() { ++ void clearChildCountCache() { + final DetailAstImpl parent = new DetailAstImpl(); + final DetailAstImpl child = new DetailAstImpl(); + parent.setFirstChild(child); +@@ -367,7 +367,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheGetChildCount() { ++ void cacheGetChildCount() { + final DetailAST root = new DetailAstImpl(); + + TestUtil.setInternalState(root, "childCount", 999); +@@ -375,7 +375,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddNextSibling() { ++ void addNextSibling() { + final DetailAstImpl parent = new DetailAstImpl(); + final DetailAstImpl child = new DetailAstImpl(); + final DetailAstImpl sibling = new DetailAstImpl(); +@@ -390,7 +390,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddNextSiblingNullParent() { ++ void addNextSiblingNullParent() { + final DetailAstImpl child = new DetailAstImpl(); + final DetailAstImpl newSibling = new DetailAstImpl(); + final DetailAstImpl oldParent = new DetailAstImpl(); +@@ -403,7 +403,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetLineNo() { ++ void getLineNo() { + final DetailAstImpl root1 = new DetailAstImpl(); + root1.setLineNo(1); + assertWithMessage("Invalid line number").that(root1.getLineNo()).isEqualTo(1); +@@ -429,7 +429,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetColumnNo() { ++ void getColumnNo() { + final DetailAstImpl root1 = new DetailAstImpl(); + root1.setColumnNo(1); + assertWithMessage("Invalid column number").that(root1.getColumnNo()).isEqualTo(1); +@@ -457,7 +457,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFindFirstToken() { ++ void findFirstToken() { + final DetailAstImpl root = new DetailAstImpl(); + final DetailAstImpl firstChild = new DetailAstImpl(); + firstChild.setType(TokenTypes.IDENT); +@@ -479,10 +479,10 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testManyComments() throws Exception { ++ void manyComments() throws Exception { + final File file = new File(temporaryFolder, "InputDetailASTManyComments.java"); + +- try (Writer bw = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { ++ try (Writer bw = Files.newBufferedWriter(file.toPath(), UTF_8)) { + bw.write("class C {\n"); + for (int i = 0; i <= 30000; i++) { + bw.write("// " + i + "\n"); +@@ -497,7 +497,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTreeStructure() throws Exception { ++ void treeStructure() throws Exception { + final List files = + getAllFiles(new File("src/test/resources/com/puppycrawl/tools/checkstyle")); + +@@ -513,7 +513,7 @@ public class DetailAstImplTest extends AbstractModuleTestSupport { + } + + @Test +- public void testToString() { ++ void testToString() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setText("text"); + ast.setColumnNo(0); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinterTest.java +index de2651004..6cb3568a4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinterTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import java.io.File; + import org.junit.jupiter.api.Test; + +-public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { ++final class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,21 +38,21 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(DetailNodeTreeStringPrinter.class)) + .isTrue(); + } + + @Test +- public void testParseFile() throws Exception { ++ void parseFile() throws Exception { + verifyJavadocTree( + getPath("ExpectedDetailNodeTreeStringPrinterJavadocComment.txt"), + getPath("InputDetailNodeTreeStringPrinterJavadocComment.javadoc")); + } + + @Test +- public void testParseFileWithError() throws Exception { ++ void parseFileWithError() throws Exception { + final File file = new File(getPath("InputDetailNodeTreeStringPrinterJavadocWithError.javadoc")); + try { + DetailNodeTreeStringPrinter.printFileAst(file); +@@ -70,14 +70,14 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testNoUnnecessaryTextInJavadocAst() throws Exception { ++ void noUnnecessaryTextInJavadocAst() throws Exception { + verifyJavadocTree( + getPath("ExpectedDetailNodeTreeStringPrinterNoUnnecessaryTextInJavadocAst.txt"), + getPath("InputDetailNodeTreeStringPrinterNoUnnecessaryTextInJavadocAst.javadoc")); + } + + @Test +- public void testMissedHtmlTagParseErrorMessage() throws Exception { ++ void missedHtmlTagParseErrorMessage() throws Exception { + final String actual = + TestUtil.invokeStaticMethod( + DetailNodeTreeStringPrinter.class, +@@ -98,7 +98,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testParseErrorMessage() throws Exception { ++ void parseErrorMessage() throws Exception { + final String actual = + TestUtil.invokeStaticMethod( + DetailNodeTreeStringPrinter.class, +@@ -124,7 +124,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testWrongSingletonParseErrorMessage() throws Exception { ++ void wrongSingletonParseErrorMessage() throws Exception { + final String actual = + TestUtil.invokeStaticMethod( + DetailNodeTreeStringPrinter.class, +@@ -146,7 +146,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testUnescapedJavaCodeWithGenericsInJavadoc() throws Exception { ++ void unescapedJavaCodeWithGenericsInJavadoc() throws Exception { + final File file = + new File( + getPath( +@@ -168,7 +168,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testNoViableAltException() throws Exception { ++ void noViableAltException() throws Exception { + final File file = + new File(getPath("InputDetailNodeTreeStringPrinterNoViableAltException.javadoc")); + try { +@@ -192,7 +192,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testHtmlTagCloseBeforeTagOpen() throws Exception { ++ void htmlTagCloseBeforeTagOpen() throws Exception { + final File file = + new File(getPath("InputDetailNodeTreeStringPrinterHtmlTagCloseBeforeTagOpen.javadoc")); + try { +@@ -216,7 +216,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testWrongHtmlTagOrder() throws Exception { ++ void wrongHtmlTagOrder() throws Exception { + final File file = + new File(getPath("InputDetailNodeTreeStringPrinterWrongHtmlTagOrder.javadoc")); + try { +@@ -235,7 +235,7 @@ public class DetailNodeTreeStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testOmittedStartTagForHtmlElement() throws Exception { ++ void omittedStartTagForHtmlElement() throws Exception { + final File file = + new File(getPath("InputDetailNodeTreeStringPrinterOmittedStartTagForHtmlElement.javadoc")); + try { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/JavaAstVisitorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/JavaAstVisitorTest.java +index fe04dae72..425fa070c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/JavaAstVisitorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavaAstVisitorTest.java +@@ -39,13 +39,12 @@ import java.util.ArrayList; + import java.util.Arrays; + import java.util.List; + import java.util.Set; +-import java.util.stream.Collectors; + import org.antlr.v4.runtime.CharStream; + import org.antlr.v4.runtime.CharStreams; + import org.antlr.v4.runtime.CommonTokenStream; + import org.junit.jupiter.api.Test; + +-public class JavaAstVisitorTest extends AbstractModuleTestSupport { ++final class JavaAstVisitorTest extends AbstractModuleTestSupport { + + /** + * If a visit method is not overridden, we should explain why we do not 'visit' the parse tree at +@@ -94,7 +93,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllVisitMethodsAreOverridden() { ++ void allVisitMethodsAreOverridden() { + final Method[] baseVisitMethods = JavaLanguageParserBaseVisitor.class.getDeclaredMethods(); + final Method[] visitMethods = JavaAstVisitor.class.getDeclaredMethods(); + +@@ -104,7 +103,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { + .filter(method -> method.getName().contains("visit")) + .filter(method -> method.getModifiers() == Modifier.PUBLIC) + .map(Method::getName) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + + final ImmutableSet filteredVisitMethodNames = + Arrays.stream(visitMethods) +@@ -128,7 +127,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOrderOfVisitMethodsAndProductionRules() throws Exception { ++ void orderOfVisitMethodsAndProductionRules() throws Exception { + // Order of BaseVisitor's generated 'visit' methods match the order of + // production rules in 'JavaLanguageParser.g4'. + final String baseVisitorFilename = +@@ -197,7 +196,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullSelfInAddLastSibling() throws Exception { ++ void nullSelfInAddLastSibling() throws Exception { + final Method addLastSibling = + JavaAstVisitor.class.getDeclaredMethod( + "addLastSibling", DetailAstImpl.class, DetailAstImpl.class); +@@ -223,7 +222,7 @@ public class JavaAstVisitorTest extends AbstractModuleTestSupport { + * @throws Exception if input file does not exist + */ + @Test +- public void testNoStackOverflowOnDeepStringConcat() throws Exception { ++ void noStackOverflowOnDeepStringConcat() throws Exception { + final File file = + new File(getPath("InputJavaAstVisitorNoStackOverflowOnDeepStringConcat.java")); + final FileText fileText = new FileText(file, StandardCharsets.UTF_8.name()); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java +index e305fa241..96a562cca 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavaParserTest.java +@@ -32,7 +32,7 @@ import java.util.List; + import java.util.Optional; + import org.junit.jupiter.api.Test; + +-public class JavaParserTest extends AbstractModuleTestSupport { ++final class JavaParserTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,21 +40,21 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(TestUtil.isUtilsClassHasPrivateConstructor(JavaParser.class)) + .isTrue(); + } + + @Test +- public void testNullRootWithComments() { ++ void nullRootWithComments() { + assertWithMessage("Invalid return root") + .that(JavaParser.appendHiddenCommentNodes(null)) + .isNull(); + } + + @Test +- public void testAppendHiddenBlockCommentNodes() throws Exception { ++ void appendHiddenBlockCommentNodes() throws Exception { + final DetailAST root = + JavaParser.parseFile( + new File(getPath("InputJavaParserHiddenComments.java")), +@@ -66,7 +66,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + + assertWithMessage("Block comment should be present").that(blockComment.isPresent()).isTrue(); + +- final DetailAST comment = blockComment.get(); ++ final DetailAST comment = blockComment.orElseThrow(); + + assertWithMessage("Unexpected line number").that(comment.getLineNo()).isEqualTo(3); + assertWithMessage("Unexpected column number").that(comment.getColumnNo()).isEqualTo(0); +@@ -82,7 +82,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAppendHiddenSingleLineCommentNodes() throws Exception { ++ void appendHiddenSingleLineCommentNodes() throws Exception { + final DetailAST root = + JavaParser.parseFile( + new File(getPath("InputJavaParserHiddenComments.java")), +@@ -95,7 +95,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + .that(singleLineComment.isPresent()) + .isTrue(); + +- final DetailAST comment = singleLineComment.get(); ++ final DetailAST comment = singleLineComment.orElseThrow(); + + assertWithMessage("Unexpected line number").that(comment.getLineNo()).isEqualTo(13); + assertWithMessage("Unexpected column number").that(comment.getColumnNo()).isEqualTo(0); +@@ -114,7 +114,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAppendHiddenSingleLineCommentNodes2() throws Exception { ++ void appendHiddenSingleLineCommentNodes2() throws Exception { + final DetailAST root = + JavaParser.parseFile( + new File(getPath("InputJavaParserHiddenComments2.java")), +@@ -127,7 +127,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + .that(singleLineComment.isPresent()) + .isTrue(); + +- final DetailAST comment = singleLineComment.get(); ++ final DetailAST comment = singleLineComment.orElseThrow(); + + assertWithMessage("Unexpected line number").that(comment.getLineNo()).isEqualTo(1); + assertWithMessage("Unexpected column number").that(comment.getColumnNo()).isEqualTo(4); +@@ -146,7 +146,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDontAppendCommentNodes() throws Exception { ++ void dontAppendCommentNodes() throws Exception { + final DetailAST root = + JavaParser.parseFile( + new File(getPath("InputJavaParserHiddenComments.java")), +@@ -161,7 +161,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParseException() throws Exception { ++ void parseException() throws Exception { + final File input = new File(getNonCompilablePath("InputJavaParser.java")); + try { + JavaParser.parseFile(input, JavaParser.Options.WITH_COMMENTS); +@@ -186,7 +186,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testComments() throws Exception { ++ void comments() throws Exception { + final DetailAST root = + JavaParser.parseFile( + new File(getPath("InputJavaParserHiddenComments3.java")), +@@ -202,7 +202,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJava14TextBlocks() throws Exception { ++ void java14TextBlocks() throws Exception { + final DetailAST root = + JavaParser.parseFile( + new File(getNonCompilablePath("InputJavaParserTextBlocks.java")), +@@ -216,7 +216,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + .that(textBlockContent.isPresent()) + .isTrue(); + +- final DetailAST content = textBlockContent.get(); ++ final DetailAST content = textBlockContent.orElseThrow(); + final String expectedContents = "\n string"; + + assertWithMessage("Unexpected line number").that(content.getLineNo()).isEqualTo(5); +@@ -227,7 +227,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoFreezeOnDeeplyNestedLambdas() throws Exception { ++ void noFreezeOnDeeplyNestedLambdas() throws Exception { + final File file = + new File(getNonCompilablePath("InputJavaParserNoFreezeOnDeeplyNestedLambdas.java")); + assertWithMessage("File parsing should complete successfully.") +@@ -236,7 +236,7 @@ public class JavaParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFullJavaIdentifierSupport() throws Exception { ++ void fullJavaIdentifierSupport() throws Exception { + final File file = + new File(getNonCompilablePath("InputJavaParserFullJavaIdentifierSupport.java")); + assertWithMessage("File parsing should complete successfully.") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/JavadocDetailNodeParserTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/JavadocDetailNodeParserTest.java +index a4927d341..9469f2fdb 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/JavadocDetailNodeParserTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavadocDetailNodeParserTest.java +@@ -27,7 +27,7 @@ import java.nio.file.Files; + import java.nio.file.Paths; + import org.junit.jupiter.api.Test; + +-public class JavadocDetailNodeParserTest extends AbstractModuleTestSupport { ++final class JavadocDetailNodeParserTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class JavadocDetailNodeParserTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParseJavadocAsDetailNode() throws Exception { ++ void parseJavadocAsDetailNode() throws Exception { + final DetailAST ast = + JavaParser.parseFile( + new File(getPath("InputJavadocDetailNodeParser.java")), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGeneratorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGeneratorTest.java +index b1003af35..192f7e6ab 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGeneratorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/JavadocPropertiesGeneratorTest.java +@@ -20,13 +20,13 @@ + package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import java.io.File; + import java.io.FileNotFoundException; + import java.io.IOException; +-import java.nio.charset.StandardCharsets; + import java.util.Locale; + import org.apache.commons.io.FileUtils; + import org.itsallcode.io.Capturable; +@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.extension.ExtendWith; + + @ExtendWith({SystemErrGuard.class, SystemOutGuard.class}) +-public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { ++final class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + + private static final String EOL = System.lineSeparator(); + private static final String USAGE = +@@ -87,7 +87,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + * @param systemOut wrapper for {@code System.out} + */ + @BeforeEach +- public void setUp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void setUp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + systemErr.captureMuted(); + systemOut.captureMuted(); + +@@ -95,14 +95,14 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(TestUtil.isUtilsClassHasPrivateConstructor(JavadocPropertiesGenerator.class)) + .isTrue(); + } + + @Test +- public void testNonExistentArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void nonExistentArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws Exception { + JavadocPropertiesGenerator.main("--nonexistent-argument"); + +@@ -117,7 +117,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testNoDestfileSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void noDestfileSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws Exception { + JavadocPropertiesGenerator.main(getPath("InputMain.java")); + +@@ -128,7 +128,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testNoInputSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void noInputSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws Exception { + JavadocPropertiesGenerator.main("--destfile", DESTFILE_ABSOLUTE_PATH); + +@@ -139,8 +139,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testNotClass(@SysErr Capturable systemErr, @SysOut Capturable systemOut) +- throws Exception { ++ void notClass(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + JavadocPropertiesGenerator.main( + "--destfile", + DESTFILE_ABSOLUTE_PATH, +@@ -150,8 +149,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testNotExistentInputSpecified( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void notExistentInputSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + try { + JavadocPropertiesGenerator.main("--destfile", DESTFILE_ABSOLUTE_PATH, "NotExistent.java"); + assertWithMessage("Exception was expected").fail(); +@@ -177,8 +175,8 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testInvalidDestinationSpecified( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { ++ void invalidDestinationSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws Exception { + try { + // Passing a folder name will cause the FileNotFoundException. + JavadocPropertiesGenerator.main( +@@ -202,8 +200,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testCorrect(@SysErr Capturable systemErr, @SysOut Capturable systemOut) +- throws Exception { ++ void correct(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + final String expectedContent = + "EOF1=The end of file token." + + EOL +@@ -224,13 +221,12 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + DESTFILE_ABSOLUTE_PATH); + assertWithMessage("Unexpected error log").that(systemErr.getCapturedData()).isEqualTo(""); + assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(""); +- final String fileContent = FileUtils.readFileToString(DESTFILE, StandardCharsets.UTF_8); ++ final String fileContent = FileUtils.readFileToString(DESTFILE, UTF_8); + assertWithMessage("File content is not expected").that(fileContent).isEqualTo(expectedContent); + } + + @Test +- public void testEmptyJavadoc(@SysErr Capturable systemErr, @SysOut Capturable systemOut) +- throws Exception { ++ void emptyJavadoc(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + JavadocPropertiesGenerator.main( + getPath("InputJavadocPropertiesGeneratorEmptyJavadoc.java"), + "--destfile", +@@ -242,8 +238,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testNotConstants(@SysErr Capturable systemErr, @SysOut Capturable systemOut) +- throws Exception { ++ void notConstants(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + JavadocPropertiesGenerator.main( + getPath("InputJavadocPropertiesGeneratorNotConstants.java"), + "--destfile", +@@ -255,15 +250,14 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testHelp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) +- throws Exception { ++ void help(@SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + JavadocPropertiesGenerator.main("-h"); + assertWithMessage("Unexpected error log").that(systemErr.getCapturedData()).isEqualTo(""); + assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(USAGE); + } + + @Test +- public void testJavadocParseError() throws Exception { ++ void javadocParseError() throws Exception { + final String path = getPath("InputJavadocPropertiesGeneratorJavadocParseError.java"); + try { + JavadocPropertiesGenerator.main(path, "--destfile", DESTFILE_ABSOLUTE_PATH); +@@ -278,7 +272,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testNotImplementedTag() throws Exception { ++ void notImplementedTag() throws Exception { + final String path = getPath("InputJavadocPropertiesGeneratorNotImplementedTag.java"); + try { + JavadocPropertiesGenerator.main(path, "--destfile", DESTFILE_ABSOLUTE_PATH); +@@ -293,7 +287,7 @@ public class JavadocPropertiesGeneratorTest extends AbstractPathTestSupport { + } + + @Test +- public void testParseError() throws Exception { ++ void parseError() throws Exception { + final String path = getNonCompilablePath("InputJavadocPropertiesGeneratorParseError.java"); + try { + JavadocPropertiesGenerator.main(path, "--destfile", DESTFILE_ABSOLUTE_PATH); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/LocalizedMessageTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/LocalizedMessageTest.java +index a65c99db0..1027f3405 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/LocalizedMessageTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/LocalizedMessageTest.java +@@ -44,12 +44,12 @@ import org.junitpioneer.jupiter.DefaultLocale; + * @noinspectionreason ClassLoaderInstantiation - Custom class loader is needed to pass URLs for + * testing + */ +-public class LocalizedMessageTest { ++final class LocalizedMessageTest { + + private static final Locale DEFAULT_LOCALE = Locale.getDefault(); + + @Test +- public void testNullArgs() { ++ void nullArgs() { + final LocalizedMessage messageClass = + new LocalizedMessage( + Definitions.CHECKSTYLE_BUNDLE, +@@ -70,7 +70,7 @@ public class LocalizedMessageTest { + } + + @Test +- public void testBundleReloadUrlNull() throws IOException { ++ void bundleReloadUrlNull() throws IOException { + final Utf8Control control = new Utf8Control(); + final ResourceBundle bundle = + control.newBundle( +@@ -92,7 +92,7 @@ public class LocalizedMessageTest { + * @noinspectionreason IOResourceOpenedButNotSafelyClosed - no need to close resources in testing + */ + @Test +- public void testBundleReloadUrlNotNull() throws IOException { ++ void bundleReloadUrlNotNull() throws IOException { + final AtomicBoolean closed = new AtomicBoolean(); + + final InputStream inputStream = +@@ -156,7 +156,7 @@ public class LocalizedMessageTest { + * @noinspectionreason IOResourceOpenedButNotSafelyClosed - no need to close resources in testing + */ + @Test +- public void testBundleReloadUrlNotNullFalseReload() throws IOException { ++ void bundleReloadUrlNotNullFalseReload() throws IOException { + final AtomicBoolean closed = new AtomicBoolean(); + + final InputStream inputStream = +@@ -213,7 +213,7 @@ public class LocalizedMessageTest { + } + + @Test +- public void testBundleReloadUrlNotNullStreamNull() throws IOException { ++ void bundleReloadUrlNotNullStreamNull() throws IOException { + final URL url = + new URL( + "test", +@@ -240,7 +240,7 @@ public class LocalizedMessageTest { + + /** Verifies that the language specified with the system property {@code user.language} exists. */ + @Test +- public void testLanguageIsValid() { ++ void languageIsValid() { + final String language = DEFAULT_LOCALE.getLanguage(); + assumeFalse(language.isEmpty(), "Locale not set"); + assertWithMessage("Invalid language") +@@ -251,14 +251,14 @@ public class LocalizedMessageTest { + + /** Verifies that the country specified with the system property {@code user.country} exists. */ + @Test +- public void testCountryIsValid() { ++ void countryIsValid() { + final String country = DEFAULT_LOCALE.getCountry(); + assumeFalse(country.isEmpty(), "Locale not set"); + assertWithMessage("Invalid country").that(Locale.getISOCountries()).asList().contains(country); + } + + @Test +- public void testMessageInFrench() { ++ void messageInFrench() { + final LocalizedMessage violation = createSampleViolation(); + LocalizedMessage.setLocale(Locale.FRENCH); + +@@ -269,7 +269,7 @@ public class LocalizedMessageTest { + + @DefaultLocale("fr") + @Test +- public void testEnforceEnglishLanguageBySettingUnitedStatesLocale() { ++ void enforceEnglishLanguageBySettingUnitedStatesLocale() { + LocalizedMessage.setLocale(Locale.US); + final LocalizedMessage violation = createSampleViolation(); + +@@ -280,7 +280,7 @@ public class LocalizedMessageTest { + + @DefaultLocale("fr") + @Test +- public void testEnforceEnglishLanguageBySettingRootLocale() { ++ void enforceEnglishLanguageBySettingRootLocale() { + LocalizedMessage.setLocale(Locale.ROOT); + final LocalizedMessage violation = createSampleViolation(); + +@@ -297,7 +297,7 @@ public class LocalizedMessageTest { + } + + @AfterEach +- public void tearDown() { ++ void tearDown() { + LocalizedMessage.setLocale(DEFAULT_LOCALE); + } + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java +index 4728006ce..a2104609e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/MainTest.java +@@ -22,6 +22,8 @@ package com.puppycrawl.tools.checkstyle; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.AbstractPathTestSupport.addEndOfLine; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; ++import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.stream.Collectors.joining; + import static org.junit.jupiter.api.Assumptions.assumeTrue; + import static org.mockito.Mockito.mock; + import static org.mockito.Mockito.mockStatic; +@@ -40,7 +42,6 @@ import java.io.File; + import java.io.IOException; + import java.io.PrintStream; + import java.lang.reflect.Method; +-import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.nio.file.Path; + import java.nio.file.Paths; +@@ -51,7 +52,6 @@ import java.util.logging.Handler; + import java.util.logging.Level; + import java.util.logging.Logger; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import org.itsallcode.io.Capturable; + import org.itsallcode.junit.sysextensions.SystemErrGuard; + import org.itsallcode.junit.sysextensions.SystemErrGuard.SysErr; +@@ -65,7 +65,7 @@ import org.mockito.MockedStatic; + import org.mockito.Mockito; + + @ExtendWith({SystemErrGuard.class, SystemOutGuard.class}) +-public class MainTest { ++final class MainTest { + + private static final String SHORT_USAGE = + String.format( +@@ -222,7 +222,7 @@ public class MainTest { + * @param systemOut wrapper for {@code System.out} + */ + @BeforeEach +- public void setUp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void setUp(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + systemErr.captureMuted(); + systemOut.captureMuted(); + +@@ -247,14 +247,14 @@ public class MainTest { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(Main.class)) + .isTrue(); + } + + @Test +- public void testVersionPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void versionPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(0, "-V"); + assertWithMessage("Unexpected output log") + .that(systemOut.getCapturedData()) +@@ -265,7 +265,7 @@ public class MainTest { + } + + @Test +- public void testUsageHelpPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void usageHelpPrint(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(0, "-h"); + assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(USAGE); + assertWithMessage("Unexpected system error log") +@@ -274,7 +274,7 @@ public class MainTest { + } + + @Test +- public void testWrongArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void wrongArgument(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + // need to specify a file: + // is defined as a required positional param; + // picocli verifies required parameters before checking unknown options +@@ -287,8 +287,7 @@ public class MainTest { + } + + @Test +- public void testWrongArgumentMissingFiles( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void wrongArgumentMissingFiles(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-q"); + // files is defined as a required positional param; + // picocli verifies required parameters before checking unknown options +@@ -300,7 +299,7 @@ public class MainTest { + } + + @Test +- public void testNoConfigSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void noConfigSpecified(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, getPath("InputMain.java")); + assertWithMessage("Unexpected output log") + .that(systemOut.getCapturedData()) +@@ -311,8 +310,7 @@ public class MainTest { + } + + @Test +- public void testNonExistentTargetFile( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void nonExistentTargetFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-c", "/google_checks.xml", "NonExistentFile.java"); + assertWithMessage("Unexpected output log") + .that(systemOut.getCapturedData()) +@@ -323,7 +321,7 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFileButWithoutReadAccess( ++ void existingTargetFileButWithoutReadAccess( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { + final File file = + File.createTempFile("testExistingTargetFileButWithoutReadAccess", null, temporaryFolder); +@@ -342,8 +340,7 @@ public class MainTest { + } + + @Test +- public void testNonExistentConfigFile( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void nonExistentConfigFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + -1, "-c", "src/main/resources/non_existent_config.xml", getPath("InputMain.java")); + assertWithMessage("Unexpected output log") +@@ -358,8 +355,7 @@ public class MainTest { + } + + @Test +- public void testNonExistentOutputFormat( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void nonExistentOutputFormat(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-c", "/google_checks.xml", "-f", "xmlp", getPath("InputMain.java")); + assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(""); + assertWithMessage("Unexpected system error log") +@@ -372,7 +368,7 @@ public class MainTest { + } + + @Test +- public void testNonExistentClass(@SysErr Capturable systemErr) { ++ void nonExistentClass(@SysErr Capturable systemErr) { + assertMainReturnCode( + -2, "-c", getPath("InputMainConfig-non-existent-classname.xml"), getPath("InputMain.java")); + final String cause = +@@ -384,7 +380,7 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void existingTargetFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + 0, "-c", getPath("InputMainConfig-classname.xml"), getPath("InputMain.java")); + assertWithMessage("Unexpected output log") +@@ -396,8 +392,8 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFileXmlOutput( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { ++ void existingTargetFileXmlOutput(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws IOException { + assertMainReturnCode( + 0, "-c", getPath("InputMainConfig-classname.xml"), "-f", "xml", getPath("InputMain.java")); + final String expectedPath = getFilePath("InputMain.java"); +@@ -425,8 +421,7 @@ public class MainTest { + * @param systemOut the system output stream + */ + @Test +- public void testNonClosedSystemStreams( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void nonClosedSystemStreams(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + try (ShouldNotBeClosedStream stream = new ShouldNotBeClosedStream()) { + System.setOut(stream); + System.setErr(stream); +@@ -456,7 +451,7 @@ public class MainTest { + * @throws Exception if there is an error. + */ + @Test +- public void testGetOutputStreamOptionsMethod() throws Exception { ++ void getOutputStreamOptionsMethod() throws Exception { + final Path path = new File(getPath("InputMain.java")).toPath(); + final OutputStreamOptions option = + TestUtil.invokeStaticMethod(Main.class, "getOutputStreamOptions", path); +@@ -466,8 +461,7 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFilePlainOutput( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void existingTargetFilePlainOutput(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + 0, + "-c", +@@ -484,8 +478,8 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFileWithViolations( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { ++ void existingTargetFileWithViolations(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws IOException { + assertMainReturnCode( + 0, "-c", getPath("InputMainConfig-classname2.xml"), getPath("InputMain.java")); + final Violation invalidPatternMessageMain = +@@ -529,7 +523,7 @@ public class MainTest { + } + + @Test +- public void testViolationsByGoogleAndXpathSuppressions( ++ void violationsByGoogleAndXpathSuppressions( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + System.setProperty( + "org.checkstyle.google.suppressionxpathfilter.config", +@@ -545,7 +539,7 @@ public class MainTest { + } + + @Test +- public void testViolationsByGoogleAndSuppressions( ++ void violationsByGoogleAndSuppressions( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + System.setProperty( + "org.checkstyle.google.suppressionfilter.config", +@@ -561,8 +555,8 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFileWithError( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { ++ void existingTargetFileWithError(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws Exception { + assertMainReturnCode( + 2, "-c", getPath("InputMainConfig-classname2-error.xml"), getPath("InputMain.java")); + final Violation errorCounterTwoMessage = +@@ -622,8 +616,8 @@ public class MainTest { + * @throws Exception should not throw anything + */ + @Test +- public void testExistingTargetFileWithOneError( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { ++ void existingTargetFileWithOneError(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws Exception { + assertMainReturnCode( + 1, "-c", getPath("InputMainConfig-classname2-error.xml"), getPath("InputMain1.java")); + final Violation errorCounterTwoMessage = +@@ -662,7 +656,7 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFileWithOneErrorAgainstSunCheck( ++ void existingTargetFileWithOneErrorAgainstSunCheck( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + assertMainReturnCode(1, "-c", "/sun_checks.xml", getPath("InputMain1.java")); + final Violation errorCounterTwoMessage = +@@ -697,7 +691,7 @@ public class MainTest { + } + + @Test +- public void testExistentTargetFilePlainOutputToNonExistentFile( ++ void existentTargetFilePlainOutputToNonExistentFile( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + 0, +@@ -715,7 +709,7 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFilePlainOutputToFile( ++ void existingTargetFilePlainOutputToFile( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws Exception { + final String outputFile = + File.createTempFile("file", ".output", temporaryFolder).getCanonicalPath(); +@@ -736,7 +730,7 @@ public class MainTest { + } + + @Test +- public void testCreateNonExistentOutputFile() throws IOException { ++ void createNonExistentOutputFile() throws IOException { + final String outputFile = new File(temporaryFolder, "nonexistent.out").getCanonicalPath(); + assertWithMessage("File must not exist").that(new File(outputFile).exists()).isFalse(); + assertMainReturnCode( +@@ -752,7 +746,7 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFilePlainOutputProperties( ++ void existingTargetFilePlainOutputProperties( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + 0, +@@ -770,7 +764,7 @@ public class MainTest { + } + + @Test +- public void testPropertyFileWithPropertyChaining( ++ void propertyFileWithPropertyChaining( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + 0, +@@ -789,7 +783,7 @@ public class MainTest { + } + + @Test +- public void testPropertyFileWithPropertyChainingUndefinedProperty( ++ void propertyFileWithPropertyChainingUndefinedProperty( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + -2, +@@ -806,7 +800,7 @@ public class MainTest { + } + + @Test +- public void testExistingTargetFilePlainOutputNonexistentProperties( ++ void existingTargetFilePlainOutputNonexistentProperties( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + -1, +@@ -824,7 +818,7 @@ public class MainTest { + } + + @Test +- public void testExistingIncorrectConfigFile(@SysErr Capturable systemErr) { ++ void existingIncorrectConfigFile(@SysErr Capturable systemErr) { + assertMainReturnCode( + -2, "-c", getPath("InputMainConfig-Incorrect.xml"), getPath("InputMain.java")); + final String errorOutput = +@@ -836,7 +830,7 @@ public class MainTest { + } + + @Test +- public void testExistingIncorrectChildrenInConfigFile(@SysErr Capturable systemErr) { ++ void existingIncorrectChildrenInConfigFile(@SysErr Capturable systemErr) { + assertMainReturnCode( + -2, "-c", getPath("InputMainConfig-incorrectChildren.xml"), getPath("InputMain.java")); + final String errorOutput = +@@ -849,7 +843,7 @@ public class MainTest { + } + + @Test +- public void testExistingIncorrectChildrenInConfigFile2(@SysErr Capturable systemErr) { ++ void existingIncorrectChildrenInConfigFile2(@SysErr Capturable systemErr) { + assertMainReturnCode( + -2, "-c", getPath("InputMainConfig-incorrectChildren2.xml"), getPath("InputMain.java")); + final String errorOutput = +@@ -863,7 +857,7 @@ public class MainTest { + } + + @Test +- public void testLoadPropertiesIoException() throws Exception { ++ void loadPropertiesIoException() throws Exception { + final Class[] param = new Class[1]; + param[0] = File.class; + final Class cliOptionsClass = Class.forName(Main.class.getName()); +@@ -905,8 +899,8 @@ public class MainTest { + } + + @Test +- public void testExistingDirectoryWithViolations( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { ++ void existingDirectoryWithViolations(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws IOException { + // we just reference there all violations + final String[][] outputValues = { + {"InputMainComplexityOverflow", "1", "172"}, +@@ -953,7 +947,7 @@ public class MainTest { + * does not require serialization + */ + @Test +- public void testListFilesNotFile() throws Exception { ++ void listFilesNotFile() throws Exception { + final File fileMock = + new File("") { + private static final long serialVersionUID = 1L; +@@ -987,7 +981,7 @@ public class MainTest { + * does not require serialization + */ + @Test +- public void testListFilesDirectoryWithNull() throws Exception { ++ void listFilesDirectoryWithNull() throws Exception { + final File[] nullResult = null; + final File fileMock = + new File("") { +@@ -1015,7 +1009,7 @@ public class MainTest { + } + + @Test +- public void testFileReferenceDuringException(@SysErr Capturable systemErr) { ++ void fileReferenceDuringException(@SysErr Capturable systemErr) { + // We put xml as source to cause parse exception + assertMainReturnCode( + -2, +@@ -1033,7 +1027,7 @@ public class MainTest { + } + + @Test +- public void testRemoveLexerDefaultErrorListener(@SysErr Capturable systemErr) { ++ void removeLexerDefaultErrorListener(@SysErr Capturable systemErr) { + assertMainReturnCode(-2, "-t", getNonCompilablePath("InputMainIncorrectClass.java")); + + assertWithMessage("First line of exception message should not contain lexer error.") +@@ -1042,7 +1036,7 @@ public class MainTest { + } + + @Test +- public void testRemoveParserDefaultErrorListener(@SysErr Capturable systemErr) { ++ void removeParserDefaultErrorListener(@SysErr Capturable systemErr) { + assertMainReturnCode(-2, "-t", getNonCompilablePath("InputMainIncorrectClass.java")); + final String capturedData = systemErr.getCapturedData(); + +@@ -1057,8 +1051,7 @@ public class MainTest { + } + + @Test +- public void testPrintTreeOnMoreThanOneFile( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printTreeOnMoreThanOneFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-t", getPath("")); + assertWithMessage("Unexpected output log") + .that(systemOut.getCapturedData()) +@@ -1069,7 +1062,7 @@ public class MainTest { + } + + @Test +- public void testPrintTreeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printTreeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -1111,7 +1104,7 @@ public class MainTest { + } + + @Test +- public void testPrintXpathOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printXpathOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -1136,8 +1129,7 @@ public class MainTest { + } + + @Test +- public void testPrintXpathCommentNode( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printXpathCommentNode(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -1159,8 +1151,7 @@ public class MainTest { + } + + @Test +- public void testPrintXpathNodeParentNull( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printXpathNodeParentNull(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = addEndOfLine("COMPILATION_UNIT -> COMPILATION_UNIT [1:0]"); + assertMainReturnCode(0, "-b", "/COMPILATION_UNIT", getPath("InputMainXPath.java")); + assertWithMessage("Unexpected output log") +@@ -1172,7 +1163,7 @@ public class MainTest { + } + + @Test +- public void testPrintXpathFullOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printXpathFullOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -1194,7 +1185,7 @@ public class MainTest { + } + + @Test +- public void testPrintXpathTwoResults(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printXpathTwoResults(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -1220,7 +1211,7 @@ public class MainTest { + } + + @Test +- public void testPrintXpathInvalidXpath(@SysErr Capturable systemErr) throws Exception { ++ void printXpathInvalidXpath(@SysErr Capturable systemErr) throws Exception { + final String invalidXpath = + "\\/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='Two']]" + "//METHOD_DEF"; + final String filePath = getFilePath("InputMainXPath.java"); +@@ -1238,8 +1229,7 @@ public class MainTest { + } + + @Test +- public void testPrintTreeCommentsOption( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printTreeCommentsOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -1293,7 +1283,7 @@ public class MainTest { + * @noinspectionreason RedundantThrows - false positive + */ + @Test +- public void testPrintTreeJavadocOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void printTreeJavadocOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws IOException { + final String expected = + Files.readString(Paths.get(getPath("InputMainExpectedInputJavadocComment.txt"))) +@@ -1311,8 +1301,7 @@ public class MainTest { + } + + @Test +- public void testPrintSuppressionOption( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void printSuppressionOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputMainSuppressionsStringPrinter']]", +@@ -1331,7 +1320,7 @@ public class MainTest { + } + + @Test +- public void testPrintSuppressionAndTabWidthOption( ++ void printSuppressionAndTabWidthOption( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( +@@ -1363,7 +1352,7 @@ public class MainTest { + } + + @Test +- public void testPrintSuppressionConflictingOptionsTvsC( ++ void printSuppressionConflictingOptionsTvsC( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-c", "/google_checks.xml", getPath(""), "-s", "2:4"); + assertWithMessage("Unexpected output log") +@@ -1375,7 +1364,7 @@ public class MainTest { + } + + @Test +- public void testPrintSuppressionConflictingOptionsTvsP( ++ void printSuppressionConflictingOptionsTvsP( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode( + -1, "-p", getPath("InputMainMycheckstyle.properties"), "-s", "2:4", getPath("")); +@@ -1388,7 +1377,7 @@ public class MainTest { + } + + @Test +- public void testPrintSuppressionConflictingOptionsTvsF( ++ void printSuppressionConflictingOptionsTvsF( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-f", "plain", "-s", "2:4", getPath("")); + assertWithMessage("Unexpected output log") +@@ -1400,7 +1389,7 @@ public class MainTest { + } + + @Test +- public void testPrintSuppressionConflictingOptionsTvsO( ++ void printSuppressionConflictingOptionsTvsO( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { + final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); + +@@ -1414,7 +1403,7 @@ public class MainTest { + } + + @Test +- public void testPrintSuppressionOnMoreThanOneFile( ++ void printSuppressionOnMoreThanOneFile( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-s", "2:4", getPath(""), getPath("")); + assertWithMessage("Unexpected output log") +@@ -1427,7 +1416,7 @@ public class MainTest { + } + + @Test +- public void testGenerateXpathSuppressionOptionOne( ++ void generateXpathSuppressionOptionOne( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( +@@ -1546,7 +1535,7 @@ public class MainTest { + } + + @Test +- public void testGenerateXpathSuppressionOptionTwo( ++ void generateXpathSuppressionOptionTwo( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( +@@ -1593,7 +1582,7 @@ public class MainTest { + } + + @Test +- public void testGenerateXpathSuppressionOptionEmptyConfig( ++ void generateXpathSuppressionOptionEmptyConfig( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = ""; + +@@ -1612,8 +1601,7 @@ public class MainTest { + } + + @Test +- public void testGenerateXpathSuppressionOptionCustomOutput(@SysErr Capturable systemErr) +- throws IOException { ++ void generateXpathSuppressionOptionCustomOutput(@SysErr Capturable systemErr) throws IOException { + final String expected = + addEndOfLine( + "", +@@ -1639,7 +1627,7 @@ public class MainTest { + "--generate-xpath-suppression", + getPath("InputMainGenerateXpathSuppressionsTabWidth.java")); + try (BufferedReader br = Files.newBufferedReader(file.toPath())) { +- final String fileContent = br.lines().collect(Collectors.joining(EOL, "", EOL)); ++ final String fileContent = br.lines().collect(joining(EOL, "", EOL)); + assertWithMessage("Unexpected output log").that(fileContent).isEqualTo(expected); + assertWithMessage("Unexpected system error log") + .that(systemErr.getCapturedData()) +@@ -1648,7 +1636,7 @@ public class MainTest { + } + + @Test +- public void testGenerateXpathSuppressionOptionDefaultTabWidth( ++ void generateXpathSuppressionOptionDefaultTabWidth( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = + addEndOfLine( +@@ -1681,7 +1669,7 @@ public class MainTest { + } + + @Test +- public void testGenerateXpathSuppressionOptionCustomTabWidth( ++ void generateXpathSuppressionOptionCustomTabWidth( + @SysErr Capturable systemErr, @SysOut Capturable systemOut) { + final String expected = ""; + +@@ -1711,7 +1699,7 @@ public class MainTest { + * @noinspectionreason RedundantThrows - false positive + */ + @Test +- public void testPrintFullTreeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void printFullTreeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws IOException { + final String expected = + Files.readString( +@@ -1730,8 +1718,7 @@ public class MainTest { + } + + @Test +- public void testConflictingOptionsTvsC( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void conflictingOptionsTvsC(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-c", "/google_checks.xml", "-t", getPath("")); + assertWithMessage("Unexpected output log") + .that(systemOut.getCapturedData()) +@@ -1742,8 +1729,7 @@ public class MainTest { + } + + @Test +- public void testConflictingOptionsTvsP( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void conflictingOptionsTvsP(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-p", getPath("InputMainMycheckstyle.properties"), "-t", getPath("")); + assertWithMessage("Unexpected output log") + .that(systemOut.getCapturedData()) +@@ -1754,8 +1740,7 @@ public class MainTest { + } + + @Test +- public void testConflictingOptionsTvsF( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void conflictingOptionsTvsF(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1, "-f", "plain", "-t", getPath("")); + assertWithMessage("Unexpected output log") + .that(systemOut.getCapturedData()) +@@ -1766,7 +1751,7 @@ public class MainTest { + } + + @Test +- public void testConflictingOptionsTvsS(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void conflictingOptionsTvsS(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws IOException { + final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); + +@@ -1780,7 +1765,7 @@ public class MainTest { + } + + @Test +- public void testConflictingOptionsTvsO(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void conflictingOptionsTvsO(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws IOException { + final String outputPath = new File(temporaryFolder, "file.output").getCanonicalPath(); + +@@ -1794,7 +1779,7 @@ public class MainTest { + } + + @Test +- public void testDebugOption(@SysErr Capturable systemErr) { ++ void debugOption(@SysErr Capturable systemErr) { + assertMainReturnCode(0, "-c", "/google_checks.xml", getPath("InputMain.java"), "-d"); + assertWithMessage("Unexpected system error log") + .that(systemErr.getCapturedData()) +@@ -1802,7 +1787,7 @@ public class MainTest { + } + + @Test +- public void testExcludeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void excludeOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws IOException { + final String filePath = getFilePath(""); + assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-e", filePath); +@@ -1815,7 +1800,7 @@ public class MainTest { + } + + @Test +- public void testExcludeOptionFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void excludeOptionFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws IOException { + final String filePath = getFilePath("InputMain.java"); + assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-e", filePath); +@@ -1828,7 +1813,7 @@ public class MainTest { + } + + @Test +- public void testExcludeRegexpOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ void excludeRegexpOption(@SysErr Capturable systemErr, @SysOut Capturable systemOut) + throws IOException { + final String filePath = getFilePath(""); + assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-x", "."); +@@ -1839,8 +1824,8 @@ public class MainTest { + } + + @Test +- public void testExcludeRegexpOptionFile( +- @SysErr Capturable systemErr, @SysOut Capturable systemOut) throws IOException { ++ void excludeRegexpOptionFile(@SysErr Capturable systemErr, @SysOut Capturable systemOut) ++ throws IOException { + final String filePath = getFilePath("InputMain.java"); + assertMainReturnCode(-1, "-c", "/google_checks.xml", filePath, "-x", "."); + assertWithMessage("Unexpected output log") +@@ -1849,9 +1834,9 @@ public class MainTest { + assertWithMessage("Unexpected output log").that(systemErr.getCapturedData()).isEqualTo(""); + } + +- @Test + @SuppressWarnings("unchecked") +- public void testExcludeDirectoryNotMatch() throws Exception { ++ @Test ++ void excludeDirectoryNotMatch() throws Exception { + final Class optionsClass = Class.forName(Main.class.getName()); + final Method method = optionsClass.getDeclaredMethod("listFiles", File.class, List.class); + method.setAccessible(true); +@@ -1863,7 +1848,7 @@ public class MainTest { + } + + @Test +- public void testCustomRootModule(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void customRootModule(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + TestRootModuleChecker.reset(); + + assertMainReturnCode( +@@ -1879,7 +1864,7 @@ public class MainTest { + } + + @Test +- public void testCustomSimpleRootModule(@SysErr Capturable systemErr) { ++ void customSimpleRootModule(@SysErr Capturable systemErr) { + TestRootModuleChecker.reset(); + assertMainReturnCode( + -2, +@@ -1908,8 +1893,7 @@ public class MainTest { + } + + @Test +- public void testExceptionOnExecuteIgnoredModuleWithUnknownModuleName( +- @SysErr Capturable systemErr) { ++ void exceptionOnExecuteIgnoredModuleWithUnknownModuleName(@SysErr Capturable systemErr) { + assertMainReturnCode( + -2, + "-c", +@@ -1925,8 +1909,7 @@ public class MainTest { + } + + @Test +- public void testExceptionOnExecuteIgnoredModuleWithBadPropertyValue( +- @SysErr Capturable systemErr) { ++ void exceptionOnExecuteIgnoredModuleWithBadPropertyValue(@SysErr Capturable systemErr) { + assertMainReturnCode( + -2, + "-c", +@@ -1946,15 +1929,14 @@ public class MainTest { + } + + @Test +- public void testNoProblemOnExecuteIgnoredModuleWithBadPropertyValue( +- @SysErr Capturable systemErr) { ++ void noProblemOnExecuteIgnoredModuleWithBadPropertyValue(@SysErr Capturable systemErr) { + assertMainReturnCode( + 0, "-c", getPath("InputMainConfig-TypeName-bad-value.xml"), "", getPath("InputMain.java")); + assertWithMessage("Unexpected system error log").that(systemErr.getCapturedData()).isEmpty(); + } + + @Test +- public void testMissingFiles(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { ++ void missingFiles(@SysErr Capturable systemErr, @SysOut Capturable systemOut) { + assertMainReturnCode(-1); + final String usage = "Missing required parameter: ''" + EOL + SHORT_USAGE; + assertWithMessage("Unexpected output log").that(systemOut.getCapturedData()).isEqualTo(""); +@@ -1964,13 +1946,13 @@ public class MainTest { + } + + @Test +- public void testOutputFormatToStringLowercase() { ++ void outputFormatToStringLowercase() { + assertWithMessage("expected xml").that(Main.OutputFormat.XML.toString()).isEqualTo("xml"); + assertWithMessage("expected plain").that(Main.OutputFormat.PLAIN.toString()).isEqualTo("plain"); + } + + @Test +- public void testXmlOutputFormatCreateListener() throws IOException { ++ void xmlOutputFormatCreateListener() throws IOException { + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + final AuditListener listener = + Main.OutputFormat.XML.createListener(out, OutputStreamOptions.CLOSE); +@@ -1978,7 +1960,7 @@ public class MainTest { + } + + @Test +- public void testSarifOutputFormatCreateListener() throws IOException { ++ void sarifOutputFormatCreateListener() throws IOException { + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + final AuditListener listener = + Main.OutputFormat.SARIF.createListener(out, OutputStreamOptions.CLOSE); +@@ -1986,7 +1968,7 @@ public class MainTest { + } + + @Test +- public void testPlainOutputFormatCreateListener() throws IOException { ++ void plainOutputFormatCreateListener() throws IOException { + final ByteArrayOutputStream out = new ByteArrayOutputStream(); + final AuditListener listener = + Main.OutputFormat.PLAIN.createListener(out, OutputStreamOptions.CLOSE); +@@ -2006,7 +1988,7 @@ public class MainTest { + * avoid VM termination. + */ + private static void assertMainReturnCode(int expectedExitCode, String... arguments) { +- final Runtime mock = mock(Runtime.class); ++ final Runtime mock = mock(); + try (MockedStatic runtime = mockStatic(Runtime.class)) { + runtime.when(Runtime::getRuntime).thenReturn(mock); + Main.main(arguments); +@@ -2025,7 +2007,7 @@ public class MainTest { + private boolean isClosed; + + private ShouldNotBeClosedStream() { +- super(new ByteArrayOutputStream(), false, StandardCharsets.UTF_8); ++ super(new ByteArrayOutputStream(), false, UTF_8); + } + + @Override +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLoggerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLoggerTest.java +index cdb6b0cde..0d3860947 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLoggerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/MetadataGeneratorLoggerTest.java +@@ -31,10 +31,10 @@ import java.io.IOException; + import java.io.OutputStream; + import org.junit.jupiter.api.Test; + +-public class MetadataGeneratorLoggerTest { ++final class MetadataGeneratorLoggerTest { + + @Test +- public void testIgnoreSeverityLevel() { ++ void ignoreSeverityLevel() { + final OutputStream outputStream = new ByteArrayOutputStream(); + final MetadataGeneratorLogger logger = + new MetadataGeneratorLogger(outputStream, OutputStreamOptions.CLOSE); +@@ -59,7 +59,7 @@ public class MetadataGeneratorLoggerTest { + } + + @Test +- public void testAddException() { ++ void addException() { + final OutputStream outputStream = new ByteArrayOutputStream(); + final MetadataGeneratorLogger logger = + new MetadataGeneratorLogger(outputStream, OutputStreamOptions.CLOSE); +@@ -72,7 +72,7 @@ public class MetadataGeneratorLoggerTest { + } + + @Test +- public void testClose() throws IOException { ++ void close() throws IOException { + try (CloseAndFlushTestByteArrayOutputStream outputStream = + new CloseAndFlushTestByteArrayOutputStream()) { + final MetadataGeneratorLogger logger = +@@ -83,7 +83,7 @@ public class MetadataGeneratorLoggerTest { + } + + @Test +- public void testCloseOutputStreamOptionNone() throws IOException { ++ void closeOutputStreamOptionNone() throws IOException { + try (CloseAndFlushTestByteArrayOutputStream outputStream = + new CloseAndFlushTestByteArrayOutputStream()) { + final MetadataGeneratorLogger logger = +@@ -95,7 +95,7 @@ public class MetadataGeneratorLoggerTest { + } + + @Test +- public void testFlushStreams() throws Exception { ++ void flushStreams() throws Exception { + try (CloseAndFlushTestByteArrayOutputStream outputStream = + new CloseAndFlushTestByteArrayOutputStream()) { + final MetadataGeneratorLogger logger = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java +index a5370025e..1e57f376c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/PackageNamesLoaderTest.java +@@ -20,7 +20,9 @@ + package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.Collections.emptyEnumeration; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import java.io.File; + import java.io.IOException; +@@ -44,7 +46,7 @@ import org.xml.sax.SAXException; + * pretend these are loaded from the classpath though we can't add/change the files for testing. + * The class loader is nested in this class, so the custom class loader we are using is safe. + */ +-public class PackageNamesLoaderTest extends AbstractPathTestSupport { ++final class PackageNamesLoaderTest extends AbstractPathTestSupport { + + @Override + protected String getPackageLocation() { +@@ -52,26 +54,25 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testDefault() throws CheckstyleException { ++ void testDefault() throws CheckstyleException { + final Set packageNames = + PackageNamesLoader.getPackageNames(Thread.currentThread().getContextClassLoader()); + assertWithMessage("pkgNames.length.").that(packageNames).isEmpty(); + } + + @Test +- public void testNoPackages() throws Exception { ++ void noPackages() throws Exception { + final Set actualPackageNames = +- PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(Collections.emptyEnumeration())); ++ PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(emptyEnumeration())); + + assertWithMessage("Invalid package names length.").that(actualPackageNames).isEmpty(); + } + + @Test +- public void testPackagesFile() throws Exception { ++ void packagesFile() throws Exception { + final Enumeration enumeration = + Collections.enumeration( +- Collections.singleton( +- new File(getPath("InputPackageNamesLoaderFile.xml")).toURI().toURL())); ++ ImmutableSet.of(new File(getPath("InputPackageNamesLoaderFile.xml")).toURI().toURL())); + + final Set actualPackageNames = + PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(enumeration)); +@@ -106,10 +107,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testPackagesWithDots() throws Exception { ++ void packagesWithDots() throws Exception { + final Enumeration enumeration = + Collections.enumeration( +- Collections.singleton( ++ ImmutableSet.of( + new File(getPath("InputPackageNamesLoaderWithDots.xml")).toURI().toURL())); + + final Set actualPackageNames = +@@ -128,10 +129,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testPackagesWithDotsEx() throws Exception { ++ void packagesWithDotsEx() throws Exception { + final Enumeration enumeration = + Collections.enumeration( +- Collections.singleton( ++ ImmutableSet.of( + new File(getPath("InputPackageNamesLoaderWithDotsEx.xml")).toURI().toURL())); + + final Set actualPackageNames = +@@ -150,10 +151,10 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testPackagesWithSaxException() throws Exception { ++ void packagesWithSaxException() throws Exception { + final Enumeration enumeration = + Collections.enumeration( +- Collections.singleton( ++ ImmutableSet.of( + new File(getPath("InputPackageNamesLoaderNotXml.java")).toURI().toURL())); + + try { +@@ -168,7 +169,7 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testPackagesWithIoException() throws Exception { ++ void packagesWithIoException() throws Exception { + final URLConnection urlConnection = + new URLConnection(null) { + @Override +@@ -194,7 +195,7 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { + } + }); + +- final Enumeration enumeration = Collections.enumeration(Collections.singleton(url)); ++ final Enumeration enumeration = Collections.enumeration(ImmutableSet.of(url)); + + try { + PackageNamesLoader.getPackageNames(new TestUrlsClassLoader(enumeration)); +@@ -212,7 +213,7 @@ public class PackageNamesLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testPackagesWithIoExceptionGetResources() { ++ void packagesWithIoExceptionGetResources() { + try { + PackageNamesLoader.getPackageNames(new TestIoExceptionClassLoader()); + assertWithMessage("CheckstyleException is expected").fail(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java +index 61a818de8..f88009508 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/PackageObjectFactoryTest.java +@@ -33,6 +33,8 @@ import static com.puppycrawl.tools.checkstyle.PackageObjectFactory.UNABLE_TO_INS + import static org.junit.jupiter.api.Assertions.assertThrows; + import static org.mockito.Mockito.mockStatic; + ++import com.google.common.collect.ImmutableList; ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.FileText; +@@ -47,7 +49,6 @@ import java.lang.reflect.Field; + import java.lang.reflect.Method; + import java.util.Arrays; + import java.util.Collection; +-import java.util.Collections; + import java.util.HashSet; + import java.util.LinkedHashSet; + import java.util.Map; +@@ -58,13 +59,13 @@ import org.mockito.MockedStatic; + import org.mockito.Mockito; + + /** Enter a description of class PackageObjectFactoryTest.java. */ +-public class PackageObjectFactoryTest { ++final class PackageObjectFactoryTest { + + private final PackageObjectFactory factory = + new PackageObjectFactory(BASE_PACKAGE, Thread.currentThread().getContextClassLoader()); + + @Test +- public void testCtorNullLoaderException1() { ++ void ctorNullLoaderException1() { + try { + final Object test = new PackageObjectFactory(new HashSet<>(), null); + assertWithMessage("Exception is expected but got " + test).fail(); +@@ -76,7 +77,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCtorNullLoaderException2() { ++ void ctorNullLoaderException2() { + try { + final Object test = new PackageObjectFactory("test", null); + assertWithMessage("Exception is expected but got " + test).fail(); +@@ -88,10 +89,10 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCtorNullPackageException1() { ++ void ctorNullPackageException1() { + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + try { +- final Object test = new PackageObjectFactory(Collections.singleton(null), classLoader); ++ final Object test = new PackageObjectFactory(ImmutableSet.of(null), classLoader); + assertWithMessage("Exception is expected but got " + test).fail(); + } catch (IllegalArgumentException ex) { + assertWithMessage("Invalid exception message") +@@ -101,7 +102,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCtorNullPackageException2() { ++ void ctorNullPackageException2() { + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + try { + final Object test = new PackageObjectFactory((String) null, classLoader); +@@ -114,12 +115,12 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCtorNullPackageException3() { ++ void ctorNullPackageException3() { + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + try { + final Object test = + new PackageObjectFactory( +- Collections.singleton(null), classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); ++ ImmutableSet.of(null), classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); + assertWithMessage("Exception is expected but got " + test).fail(); + } catch (IllegalArgumentException ex) { + assertWithMessage("Invalid exception message") +@@ -129,7 +130,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testMakeObjectFromName() throws CheckstyleException { ++ void makeObjectFromName() throws CheckstyleException { + final Checker checker = + (Checker) factory.createModule("com.puppycrawl.tools.checkstyle.Checker"); + assertWithMessage("Checker should not be null when creating module from name") +@@ -138,7 +139,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testMakeCheckFromName() { ++ void makeCheckFromName() { + final String name = "com.puppycrawl.tools.checkstyle.checks.naming.ConstantName"; + try { + factory.createModule(name); +@@ -158,7 +159,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateModuleWithNonExistName() { ++ void createModuleWithNonExistName() { + final String[] names = { + "NonExistClassOne", "NonExistClassTwo", + }; +@@ -194,7 +195,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateObjectFromMap() throws Exception { ++ void createObjectFromMap() throws Exception { + final String moduleName = "Foo"; + final String name = moduleName + CHECK_SUFFIX; + final String packageName = BASE_PACKAGE + ".packageobjectfactory.bar"; +@@ -212,7 +213,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateStandardModuleObjectFromMap() throws Exception { ++ void createStandardModuleObjectFromMap() throws Exception { + final String moduleName = "TreeWalker"; + final String packageName = BASE_PACKAGE + ".packageobjectfactory.bar"; + final String fullName = BASE_PACKAGE + PACKAGE_SEPARATOR + moduleName; +@@ -225,7 +226,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateStandardCheckModuleObjectFromMap() throws Exception { ++ void createStandardCheckModuleObjectFromMap() throws Exception { + final String moduleName = "TypeName"; + final String packageName = BASE_PACKAGE + ".packageobjectfactory.bar"; + final String fullName = +@@ -246,7 +247,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateObjectFromFullModuleNamesWithAmbiguousException() { ++ void createObjectFromFullModuleNamesWithAmbiguousException() { + final String barPackage = BASE_PACKAGE + ".packageobjectfactory.bar"; + final String fooPackage = BASE_PACKAGE + ".packageobjectfactory.foo"; + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); +@@ -280,7 +281,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateObjectFromFullModuleNamesWithCantInstantiateException() { ++ void createObjectFromFullModuleNamesWithCantInstantiateException() { + final String package1 = BASE_PACKAGE + ".wrong1"; + final String package2 = BASE_PACKAGE + ".wrong2"; + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); +@@ -325,7 +326,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateObjectFromFullModuleNamesWithExceptionByBruteForce() { ++ void createObjectFromFullModuleNamesWithExceptionByBruteForce() { + final String package1 = BASE_PACKAGE + ".wrong1"; + final String package2 = BASE_PACKAGE + ".wrong2"; + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); +@@ -374,7 +375,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateObjectByBruteForce() throws Exception { ++ void createObjectByBruteForce() throws Exception { + final String className = "Checker"; + final Method createModuleByBruteForce = + PackageObjectFactory.class.getDeclaredMethod( +@@ -387,7 +388,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateCheckByBruteForce() throws Exception { ++ void createCheckByBruteForce() throws Exception { + final String checkName = "AnnotationLocation"; + final Method createModuleByBruteForce = + PackageObjectFactory.class.getDeclaredMethod( +@@ -406,11 +407,11 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateCheckWithPartialPackageNameByBruteForce() throws Exception { ++ void createCheckWithPartialPackageNameByBruteForce() throws Exception { + final String checkName = "checks.annotation.AnnotationLocation"; + final PackageObjectFactory packageObjectFactory = + new PackageObjectFactory( +- new HashSet<>(Collections.singletonList(BASE_PACKAGE)), ++ new HashSet<>(ImmutableList.of(BASE_PACKAGE)), + Thread.currentThread().getContextClassLoader(), + TRY_IN_ALL_REGISTERED_PACKAGES); + final AnnotationLocationCheck check = +@@ -421,21 +422,21 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testJoinPackageNamesWithClassName() throws Exception { ++ void joinPackageNamesWithClassName() throws Exception { + final Class clazz = PackageObjectFactory.class; + final Method method = + clazz.getDeclaredMethod("joinPackageNamesWithClassName", String.class, Set.class); + method.setAccessible(true); +- final Set packages = Collections.singleton("test"); ++ final Set packages = ImmutableSet.of("test"); + final String className = "SomeClass"; + final String actual = + String.valueOf(method.invoke(PackageObjectFactory.class, className, packages)); + assertWithMessage("Invalid class name").that(actual).isEqualTo("test." + className); + } + +- @Test + @SuppressWarnings("unchecked") +- public void testNameToFullModuleNameMap() throws Exception { ++ @Test ++ void nameToFullModuleNameMap() throws Exception { + final Set> classes = CheckUtil.getCheckstyleModules(); + final Class packageObjectFactoryClass = PackageObjectFactory.class; + final Field field = packageObjectFactoryClass.getDeclaredField("NAME_TO_FULL_MODULE_NAME"); +@@ -466,7 +467,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testConstructorFailure() { ++ void constructorFailure() { + try { + factory.createModule(FailConstructorFileSet.class.getName()); + assertWithMessage("Exception is expected").fail(); +@@ -483,7 +484,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testGetShortFromFullModuleNames() { ++ void getShortFromFullModuleNames() { + final String fullName = "com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck"; + + assertWithMessage("Invalid simple check name") +@@ -492,7 +493,7 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testGetShortFromFullModuleNamesThirdParty() { ++ void getShortFromFullModuleNamesThirdParty() { + final String fullName = "java.util.stream.Collectors"; + + assertWithMessage("Invalid simple check name") +@@ -512,11 +513,11 @@ public class PackageObjectFactoryTest { + * @throws Exception when the code tested throws an exception + */ + @Test +- public void testGenerateThirdPartyNameToFullModuleNameWithException() throws Exception { ++ void generateThirdPartyNameToFullModuleNameWithException() throws Exception { + final String name = "String"; + final String packageName = "java.lang"; + final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); +- final Set packages = Collections.singleton(packageName); ++ final Set packages = ImmutableSet.of(packageName); + final PackageObjectFactory objectFactory = + new PackageObjectFactory(packages, classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); + +@@ -540,9 +541,9 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateObjectWithNameContainingPackageSeparator() throws Exception { ++ void createObjectWithNameContainingPackageSeparator() throws Exception { + final ClassLoader classLoader = ClassLoader.getSystemClassLoader(); +- final Set packages = Collections.singleton(BASE_PACKAGE); ++ final Set packages = ImmutableSet.of(BASE_PACKAGE); + final PackageObjectFactory objectFactory = + new PackageObjectFactory(packages, classLoader, TRY_IN_ALL_REGISTERED_PACKAGES); + +@@ -553,9 +554,9 @@ public class PackageObjectFactoryTest { + } + + @Test +- public void testCreateModuleWithTryInAllRegisteredPackages() { ++ void createModuleWithTryInAllRegisteredPackages() { + final ClassLoader classLoader = ClassLoader.getSystemClassLoader(); +- final Set packages = Collections.singleton(BASE_PACKAGE); ++ final Set packages = ImmutableSet.of(BASE_PACKAGE); + final PackageObjectFactory objectFactory = + new PackageObjectFactory(packages, classLoader, SEARCH_REGISTERED_PACKAGES); + final CheckstyleException ex = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java +index 5282d4b8e..ed16a380b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/PropertiesExpanderTest.java +@@ -24,10 +24,10 @@ import static com.google.common.truth.Truth.assertWithMessage; + import java.util.Properties; + import org.junit.jupiter.api.Test; + +-public class PropertiesExpanderTest { ++final class PropertiesExpanderTest { + + @Test +- public void testCtorException() { ++ void ctorException() { + try { + final Object test = new PropertiesExpander(null); + assertWithMessage("exception expected but got " + test).fail(); +@@ -39,7 +39,7 @@ public class PropertiesExpanderTest { + } + + @Test +- public void testDefaultProperties() { ++ void defaultProperties() { + final Properties properties = new Properties(System.getProperties()); + properties.setProperty("test", "checkstyle"); + final String propertiesUserHome = properties.getProperty("user.home"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java +index 64f149bda..01dcb3330 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/PropertyCacheFileTest.java +@@ -52,7 +52,7 @@ import org.junit.jupiter.params.ParameterizedTest; + import org.junit.jupiter.params.provider.ValueSource; + import org.mockito.MockedStatic; + +-public class PropertyCacheFileTest extends AbstractPathTestSupport { ++final class PropertyCacheFileTest extends AbstractPathTestSupport { + + @TempDir public File temporaryFolder; + +@@ -62,7 +62,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testCtor() { ++ void ctor() { + try { + final Object test = new PropertyCacheFile(null, ""); + assertWithMessage("exception expected but got " + test).fail(); +@@ -83,7 +83,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testInCache() throws IOException { ++ void inCache() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +@@ -100,7 +100,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testResetIfFileDoesNotExist() throws IOException { ++ void resetIfFileDoesNotExist() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final PropertyCacheFile cache = new PropertyCacheFile(config, "fileDoesNotExist.txt"); + +@@ -112,7 +112,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testPopulateDetails() throws IOException { ++ void populateDetails() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final PropertyCacheFile cache = + new PropertyCacheFile(config, getPath("InputPropertyCacheFile")); +@@ -134,7 +134,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testConfigHashOnReset() throws IOException { ++ void configHashOnReset() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +@@ -152,7 +152,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testConfigHashRemainsOnResetExternalResources() throws IOException { ++ void configHashRemainsOnResetExternalResources() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +@@ -178,7 +178,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testCacheRemainsWhenExternalResourceTheSame() throws IOException { ++ void cacheRemainsWhenExternalResourceTheSame() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String externalResourcePath = + File.createTempFile("junit", null, temporaryFolder).getPath(); +@@ -207,7 +207,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testExternalResourceIsSavedInCache() throws Exception { ++ void externalResourceIsSavedInCache() throws Exception { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +@@ -235,7 +235,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testCacheDirectoryDoesNotExistAndShouldBeCreated() throws IOException { ++ void cacheDirectoryDoesNotExistAndShouldBeCreated() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = + String.format( +@@ -249,7 +249,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testPathToCacheContainsOnlyFileName() throws IOException { ++ void pathToCacheContainsOnlyFileName() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String fileName = "temp.cache"; + final Path filePath = Paths.get(fileName); +@@ -262,7 +262,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testChangeInConfig() throws Exception { ++ void changeInConfig() throws Exception { + final DefaultConfiguration config = new DefaultConfiguration("myConfig"); + config.addProperty("attr", "value"); + +@@ -315,7 +315,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + * throw exception. + */ + @Test +- public void testNonExistentResource() throws IOException { ++ void nonExistentResource() throws IOException { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +@@ -350,7 +350,7 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + } + + @Test +- public void testExceptionNoSuchAlgorithmException() throws Exception { ++ void exceptionNoSuchAlgorithmException() throws Exception { + final Configuration config = new DefaultConfiguration("myName"); + final String filePath = File.createTempFile("junit", null, temporaryFolder).getPath(); + final PropertyCacheFile cache = new PropertyCacheFile(config, filePath); +@@ -389,8 +389,8 @@ public class PropertyCacheFileTest extends AbstractPathTestSupport { + * @param rawMessages exception messages separated by ';' + */ + @ParameterizedTest +- @ValueSource(strings = {"Same;Same", "First;Second"}) +- public void testPutNonExistentExternalResource(String rawMessages) throws Exception { ++ @ValueSource(strings = {"First;Second", "Same;Same"}) ++ void putNonExistentExternalResource(String rawMessages) throws Exception { + final File cacheFile = File.createTempFile("junit", null, temporaryFolder); + final String[] messages = rawMessages.split(";"); + // We mock getUriByFilename method of CommonUtil to guarantee that it will +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/SarifLoggerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/SarifLoggerTest.java +index 12bdae833..5e60dc3d9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/SarifLoggerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/SarifLoggerTest.java +@@ -20,6 +20,7 @@ + package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; + import com.puppycrawl.tools.checkstyle.api.AuditEvent; +@@ -29,10 +30,9 @@ import com.puppycrawl.tools.checkstyle.internal.utils.CloseAndFlushTestByteArray + import java.io.ByteArrayOutputStream; + import java.io.IOException; + import java.io.PrintWriter; +-import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.Test; + +-public class SarifLoggerTest extends AbstractModuleTestSupport { ++final class SarifLoggerTest extends AbstractModuleTestSupport { + + /** + * Output stream to hold the test results. The IntelliJ IDEA issues the AutoCloseableResource +@@ -48,7 +48,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEscape() { ++ void escape() { + final String[][] encodings = { + {"\"", "\\\""}, + {"\\", "\\\\"}, +@@ -71,7 +71,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddError() throws IOException { ++ void addError() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -94,7 +94,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddErrorWithWarningLevel() throws IOException { ++ void addErrorWithWarningLevel() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -117,7 +117,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddErrors() throws IOException { ++ void addErrors() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -155,7 +155,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddException() throws IOException { ++ void addException() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation message = +@@ -170,7 +170,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAddExceptions() throws IOException { ++ void addExceptions() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -192,7 +192,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineOnly() throws IOException { ++ void lineOnly() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -207,7 +207,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmpty() throws IOException { ++ void empty() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -221,7 +221,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullOutputStreamOptions() { ++ void nullOutputStreamOptions() { + try { + final SarifLogger logger = new SarifLogger(outStream, null); + // assert required to calm down eclipse's 'The allocated object is never used' violation +@@ -235,7 +235,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCloseStream() throws IOException { ++ void closeStream() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + logger.auditFinished(null); +@@ -246,7 +246,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoCloseStream() throws IOException { ++ void noCloseStream() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.NONE); + logger.auditStarted(null); + logger.auditFinished(null); +@@ -259,7 +259,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinishLocalSetup() throws IOException { ++ void finishLocalSetup() throws IOException { + final SarifLogger logger = new SarifLogger(outStream, OutputStreamOptions.CLOSE); + logger.finishLocalSetup(); + logger.auditStarted(null); +@@ -268,7 +268,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReadResourceWithInvalidName() { ++ void readResourceWithInvalidName() { + try { + SarifLogger.readResource("random"); + assertWithMessage("Exception expected").fail(); +@@ -282,8 +282,7 @@ public class SarifLoggerTest extends AbstractModuleTestSupport { + private static void verifyContent( + String expectedOutputFile, ByteArrayOutputStream actualOutputStream) throws IOException { + final String expectedContent = readFile(expectedOutputFile); +- final String actualContent = +- toLfLineEnding(actualOutputStream.toString(StandardCharsets.UTF_8)); ++ final String actualContent = toLfLineEnding(actualOutputStream.toString(UTF_8)); + assertWithMessage("sarif content should match").that(actualContent).isEqualTo(expectedContent); + } + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinterTest.java +index 38d34e8b9..e18e6320a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/SuppressionsStringPrinterTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import java.io.File; + import org.junit.jupiter.api.Test; + +-public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { ++final class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { + + private static final String EOL = System.getProperty("line.separator"); + +@@ -36,14 +36,14 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(SuppressionsStringPrinter.class)) + .isTrue(); + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String expected = + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputSuppressionsStringPrinter']]" +@@ -65,7 +65,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testCustomTabWidth() throws Exception { ++ void customTabWidth() throws Exception { + final String expected = + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputSuppressionsStringPrinter']]" +@@ -90,7 +90,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testCustomTabWidthEmptyResult() throws Exception { ++ void customTabWidthEmptyResult() throws Exception { + final File input = new File(getPath("InputSuppressionsStringPrinter.java")); + final String lineAndColumnNumber = "5:13"; + final int tabWidth = 6; +@@ -100,7 +100,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testInvalidLineAndColumnNumberParameter() throws Exception { ++ void invalidLineAndColumnNumberParameter() throws Exception { + final File input = new File(getPath("InputSuppressionsStringPrinter.java")); + final String invalidLineAndColumnNumber = "abc-432"; + final int tabWidth = 2; +@@ -115,7 +115,7 @@ public class SuppressionsStringPrinterTest extends AbstractTreeTestSupport { + } + + @Test +- public void testParseFileTextThrowable() throws Exception { ++ void parseFileTextThrowable() throws Exception { + final File input = new File(getNonCompilablePath("InputSuppressionsStringPrinter.java")); + final String lineAndColumnNumber = "2:3"; + final int tabWidth = 2; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/ThreadModeSettingsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/ThreadModeSettingsTest.java +index 83df6de43..9925033ed 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/ThreadModeSettingsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/ThreadModeSettingsTest.java +@@ -25,10 +25,10 @@ import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class ThreadModeSettingsTest { ++final class ThreadModeSettingsTest { + + @Test +- public void testProperties() { ++ void properties() { + final ThreadModeSettings config = new ThreadModeSettings(1, 2); + assertWithMessage("Invalid checker threads number") + .that(config.getCheckerThreadsNumber()) +@@ -39,7 +39,7 @@ public class ThreadModeSettingsTest { + } + + @Test +- public void testResolveCheckerInMultiThreadMode() { ++ void resolveCheckerInMultiThreadMode() { + final ThreadModeSettings configuration = new ThreadModeSettings(2, 2); + + try { +@@ -53,7 +53,7 @@ public class ThreadModeSettingsTest { + } + + @Test +- public void testResolveCheckerInSingleThreadMode() { ++ void resolveCheckerInSingleThreadMode() { + final ThreadModeSettings singleThreadMode = ThreadModeSettings.SINGLE_THREAD_MODE_INSTANCE; + + final String name = singleThreadMode.resolveName(ThreadModeSettings.CHECKER_MODULE_NAME); +@@ -63,7 +63,7 @@ public class ThreadModeSettingsTest { + } + + @Test +- public void testResolveTreeWalker() { ++ void resolveTreeWalker() { + final ThreadModeSettings configuration = new ThreadModeSettings(2, 2); + + try { +@@ -77,7 +77,7 @@ public class ThreadModeSettingsTest { + } + + @Test +- public void testResolveTreeWalkerInSingleThreadMode() { ++ void resolveTreeWalkerInSingleThreadMode() { + final ThreadModeSettings singleThreadMode = ThreadModeSettings.SINGLE_THREAD_MODE_INSTANCE; + final String actual = singleThreadMode.resolveName(ThreadModeSettings.TREE_WALKER_MODULE_NAME); + assertWithMessage("Invalid name resolved: " + actual) +@@ -86,7 +86,7 @@ public class ThreadModeSettingsTest { + } + + @Test +- public void testResolveAnyOtherModule() throws Exception { ++ void resolveAnyOtherModule() throws Exception { + final Set> allModules = CheckUtil.getCheckstyleModules(); + final ThreadModeSettings multiThreadModeSettings = new ThreadModeSettings(2, 2); + final ThreadModeSettings singleThreadModeSettings = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java +index 3b65bb886..98c026c29 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/TreeWalkerTest.java +@@ -21,10 +21,13 @@ package com.puppycrawl.tools.checkstyle; + + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; ++import static java.nio.charset.StandardCharsets.UTF_8; + import static org.mockito.ArgumentMatchers.any; + import static org.mockito.Mockito.CALLS_REAL_METHODS; + import static org.mockito.Mockito.doThrow; + import static org.mockito.Mockito.mock; ++import static org.mockito.Mockito.mockConstruction; ++import static org.mockito.Mockito.mockStatic; + + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +@@ -77,7 +80,7 @@ import org.mockito.internal.util.Checks; + * @noinspectionreason ClassWithTooManyDependencies - complex tests require a large number of + * imports + */ +-public class TreeWalkerTest extends AbstractModuleTestSupport { ++final class TreeWalkerTest extends AbstractModuleTestSupport { + + @TempDir public File temporaryFolder; + +@@ -87,10 +90,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProperFileExtension() throws Exception { ++ void properFileExtension() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ConstantNameCheck.class); + final File file = new File(temporaryFolder, "file.java"); +- try (Writer writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { ++ try (Writer writer = Files.newBufferedWriter(file.toPath(), UTF_8)) { + final String content = "public class Main { public static final int k = 5 + 4; }"; + writer.write(content); + } +@@ -128,7 +131,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + * @throws Exception if an error occurs + */ + @Test +- public void testNoAuditEventsWithoutFilters() throws Exception { ++ void noAuditEventsWithoutFilters() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OneTopLevelClassCheck.class); + final String[] expected = { + "5:1: " +@@ -136,7 +139,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + OneTopLevelClassCheck.class, OneTopLevelClassCheck.MSG_KEY, "InputTreeWalkerInner"), + }; + try (MockedConstruction mocked = +- Mockito.mockConstruction( ++ mockConstruction( + TreeWalkerAuditEvent.class, + (mock, context) -> { + throw new CheckstyleException("No audit events expected"); +@@ -150,7 +153,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + * that the {@code if (!ordinaryChecks.isEmpty())} condition cannot be removed. + */ + @Test +- public void testConditionRequiredWithoutOrdinaryChecks() throws Exception { ++ void conditionRequiredWithoutOrdinaryChecks() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(JavadocParagraphCheck.class); + final String[] expected = { + "3: " +@@ -158,12 +161,12 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + JavadocParagraphCheck.class, JavadocParagraphCheck.MSG_REDUNDANT_PARAGRAPH), + }; + final String path = getPath("InputTreeWalkerJavadoc.java"); +- final DetailAST mockAst = mock(DetailAST.class); ++ final DetailAST mockAst = mock(); + final DetailAST realAst = + JavaParser.parseFile(new File(path), JavaParser.Options.WITH_COMMENTS); + // Ensure that there is no calls to walk(..., AstState.ORDINARY) + doThrow(IllegalStateException.class).when(mockAst).getFirstChild(); +- try (MockedStatic parser = Mockito.mockStatic(JavaParser.class)) { ++ try (MockedStatic parser = mockStatic(JavaParser.class)) { + parser.when(() -> JavaParser.parse(any(FileContents.class))).thenReturn(mockAst); + // This will re-enable walk(..., AstState.WITH_COMMENTS) + parser.when(() -> JavaParser.appendHiddenCommentNodes(mockAst)).thenReturn(realAst); +@@ -177,15 +180,14 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + * that the {@code if (!commentChecks.isEmpty())} condition cannot be removed. + */ + @Test +- public void testConditionRequiredWithoutCommentChecks() throws Exception { ++ void conditionRequiredWithoutCommentChecks() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OneTopLevelClassCheck.class); + final String[] expected = { + "5:1: " + + getCheckMessage( + OneTopLevelClassCheck.class, OneTopLevelClassCheck.MSG_KEY, "InputTreeWalkerInner"), + }; +- try (MockedStatic parser = +- Mockito.mockStatic(JavaParser.class, CALLS_REAL_METHODS)) { ++ try (MockedStatic parser = mockStatic(JavaParser.class, CALLS_REAL_METHODS)) { + // Ensure that there is no calls to walk(..., AstState.WITH_COMMENTS) + parser + .when(() -> JavaParser.appendHiddenCommentNodes(any(DetailAST.class))) +@@ -196,10 +198,10 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImproperFileExtension() throws Exception { ++ void improperFileExtension() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ConstantNameCheck.class); + final File file = new File(temporaryFolder, "file.pdf"); +- try (Writer writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { ++ try (Writer writer = Files.newBufferedWriter(file.toPath(), UTF_8)) { + final String content = "public class Main { public static final int k = 5 + 4; }"; + writer.write(content); + } +@@ -208,7 +210,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptableTokens() throws Exception { ++ void acceptableTokens() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); + checkConfig.addProperty("tokens", "VARIABLE_DEF, ENUM_DEF, CLASS_DEF, METHOD_DEF," + "IMPORT"); + try { +@@ -233,7 +235,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOnEmptyFile() throws Exception { ++ void onEmptyFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); + final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -242,7 +244,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithCheckNotHavingTreeWalkerAsParent() throws Exception { ++ void withCheckNotHavingTreeWalkerAsParent() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(JavadocPackageCheck.class); + + try { +@@ -260,7 +262,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetupChildExceptions() { ++ void setupChildExceptions() { + final TreeWalker treeWalker = new TreeWalker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -281,7 +283,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSettersForParameters() throws Exception { ++ void settersForParameters() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + final DefaultConfiguration config = new DefaultConfiguration("default config"); + treeWalker.setTabWidth(1); +@@ -294,7 +296,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForInvalidCheckImplementation() throws Exception { ++ void forInvalidCheckImplementation() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(BadJavaDocCheck.class); + final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); + +@@ -310,7 +312,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessNonJavaFiles() throws Exception { ++ void processNonJavaFiles() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -338,7 +340,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessNonJavaFilesWithoutException() throws Exception { ++ void processNonJavaFilesWithoutException() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + treeWalker.setTabWidth(1); + treeWalker.configure(new DefaultConfiguration("default config")); +@@ -350,7 +352,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithCacheWithNoViolation() throws Exception { ++ void withCacheWithNoViolation() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); + final Checker checker = createChecker(checkConfig); + final PackageObjectFactory factory = +@@ -363,7 +365,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessWithParserThrowable() throws Exception { ++ void processWithParserThrowable() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + treeWalker.configure(createModuleConfig(TypeNameCheck.class)); + final PackageObjectFactory factory = +@@ -386,7 +388,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessWithRecognitionException() throws Exception { ++ void processWithRecognitionException() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + treeWalker.configure(createModuleConfig(TypeNameCheck.class)); + final PackageObjectFactory factory = +@@ -409,7 +411,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredTokenIsEmptyIntArray() throws Exception { ++ void requiredTokenIsEmptyIntArray() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RequiredTokenIsEmptyIntArray.class); + final String pathToEmptyFile = File.createTempFile("file", ".java", temporaryFolder).getPath(); + +@@ -418,7 +420,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBehaviourWithZeroChecks() throws Exception { ++ void behaviourWithZeroChecks() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -433,7 +435,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBehaviourWithOrdinaryAndCommentChecks() throws Exception { ++ void behaviourWithOrdinaryAndCommentChecks() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + treeWalker.configure(createModuleConfig(TypeNameCheck.class)); + treeWalker.configure(createModuleConfig(CommentsIndentationCheck.class)); +@@ -460,7 +462,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetupChild() throws Exception { ++ void setupChild() throws Exception { + final TreeWalker treeWalker = new TreeWalker(); + final PackageObjectFactory factory = + new PackageObjectFactory(new HashSet<>(), Thread.currentThread().getContextClassLoader()); +@@ -480,7 +482,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBehaviourWithChecksAndFilters() throws Exception { ++ void behaviourWithChecksAndFilters() throws Exception { + final DefaultConfiguration filterConfig = createModuleConfig(SuppressionCommentFilter.class); + filterConfig.addProperty("checkCPP", "false"); + +@@ -501,7 +503,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiCheckOrder() throws Exception { ++ void multiCheckOrder() throws Exception { + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); + treeWalkerConfig.addChild(createModuleConfig(WhitespaceAroundCheck.class)); + treeWalkerConfig.addChild(createModuleConfig(WhitespaceAfterCheck.class)); +@@ -515,7 +517,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinishLocalSetupFullyInitialized() { ++ void finishLocalSetupFullyInitialized() { + final TreeWalker treeWalker = new TreeWalker(); + treeWalker.setSeverity("error"); + treeWalker.setTabWidth(100); +@@ -531,7 +533,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckInitIsCalledInTreeWalker() throws Exception { ++ void checkInitIsCalledInTreeWalker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(VerifyInitCheck.class); + final File file = File.createTempFile("file", ".pdf", temporaryFolder); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -540,7 +542,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckDestroyIsCalledInTreeWalker() throws Exception { ++ void checkDestroyIsCalledInTreeWalker() throws Exception { + VerifyDestroyCheck.resetDestroyWasCalled(); + final DefaultConfiguration checkConfig = createModuleConfig(VerifyDestroyCheck.class); + final File file = File.createTempFile("file", ".pdf", temporaryFolder); +@@ -552,7 +554,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentCheckDestroyIsCalledInTreeWalker() throws Exception { ++ void commentCheckDestroyIsCalledInTreeWalker() throws Exception { + VerifyDestroyCheck.resetDestroyWasCalled(); + final DefaultConfiguration checkConfig = createModuleConfig(VerifyDestroyCommentCheck.class); + final File file = File.createTempFile("file", ".pdf", temporaryFolder); +@@ -564,7 +566,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheWhenFileExternalResourceContentDoesNotChange() throws Exception { ++ void cacheWhenFileExternalResourceContentDoesNotChange() throws Exception { + final DefaultConfiguration filterConfig = createModuleConfig(SuppressionXpathFilter.class); + filterConfig.addProperty("file", getPath("InputTreeWalkerSuppressionXpathFilter.xml")); + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); +@@ -587,7 +589,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTreeWalkerFilterAbsolutePath() throws Exception { ++ void treeWalkerFilterAbsolutePath() throws Exception { + final DefaultConfiguration filterConfig = createModuleConfig(SuppressionXpathFilter.class); + filterConfig.addProperty("file", getPath("InputTreeWalkerSuppressionXpathFilterAbsolute.xml")); + final DefaultConfiguration checkConfig = createModuleConfig(LeftCurlyCheck.class); +@@ -607,7 +609,7 @@ public class TreeWalkerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExternalResourceFiltersWithNoExternalResource() throws Exception { ++ void externalResourceFiltersWithNoExternalResource() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(EmptyStatementCheck.class); + final DefaultConfiguration filterConfig = + createModuleConfig(SuppressWithNearbyCommentFilter.class); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java +index e99028329..e1453528a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/XMLLoggerTest.java +@@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test; + + /** Enter a description of class XMLLoggerTest.java. */ + // -@cs[AbbreviationAsWordInName] Test should be named as its main class. +-public class XMLLoggerTest extends AbstractXmlTestSupport { ++final class XMLLoggerTest extends AbstractXmlTestSupport { + + /** + * Output stream to hold the test results. The IntelliJ IDEA issues the AutoCloseableResource +@@ -50,7 +50,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testEncode() throws IOException { ++ void encode() throws IOException { + final XMLLogger test = new XMLLogger(outStream, OutputStreamOptions.NONE); + assertWithMessage("should be able to create XMLLogger without issue").that(test).isNotNull(); + final String[][] encodings = { +@@ -75,7 +75,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testIsReference() throws IOException { ++ void isReference() throws IOException { + final XMLLogger test = new XMLLogger(outStream, OutputStreamOptions.NONE); + assertWithMessage("should be able to create XMLLogger without issue").that(test).isNotNull(); + final String[] references = { +@@ -97,7 +97,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testCloseStream() throws Exception { ++ void closeStream() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + logger.auditFinished(null); +@@ -108,7 +108,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testNoCloseStream() throws Exception { ++ void noCloseStream() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.NONE); + logger.auditStarted(null); + logger.auditFinished(null); +@@ -120,7 +120,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testFileStarted() throws Exception { ++ void fileStarted() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final AuditEvent ev = new AuditEvent(this, "Test.java"); +@@ -131,7 +131,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testFileFinished() throws Exception { ++ void fileFinished() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final AuditEvent ev = new AuditEvent(this, "Test.java"); +@@ -141,7 +141,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddError() throws Exception { ++ void addError() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -156,7 +156,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddErrorWithNullFileName() throws Exception { ++ void addErrorWithNullFileName() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -170,7 +170,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddErrorModuleId() throws Exception { ++ void addErrorModuleId() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -191,7 +191,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddErrorOnZeroColumns() throws Exception { ++ void addErrorOnZeroColumns() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -206,7 +206,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddIgnored() throws Exception { ++ void addIgnored() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -219,7 +219,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddException() throws Exception { ++ void addException() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -232,7 +232,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddExceptionWithNullFileName() throws Exception { ++ void addExceptionWithNullFileName() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -245,7 +245,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddExceptionAfterFileStarted() throws Exception { ++ void addExceptionAfterFileStarted() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + +@@ -264,7 +264,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddExceptionBeforeFileFinished() throws Exception { ++ void addExceptionBeforeFileFinished() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -279,7 +279,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAddExceptionBetweenFileStartedAndFinished() throws Exception { ++ void addExceptionBetweenFileStartedAndFinished() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final Violation violation = +@@ -296,7 +296,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testAuditFinishedWithoutFileFinished() throws Exception { ++ void auditFinishedWithoutFileFinished() throws Exception { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.auditStarted(null); + final AuditEvent fileStartedEvent = new AuditEvent(this, "Test.java"); +@@ -314,7 +314,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testNullOutputStreamOptions() { ++ void nullOutputStreamOptions() { + try { + final XMLLogger logger = new XMLLogger(outStream, (OutputStreamOptions) null); + // assert required to calm down eclipse's 'The allocated object is never used' violation +@@ -328,7 +328,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + } + + @Test +- public void testFinishLocalSetup() { ++ void finishLocalSetup() { + final XMLLogger logger = new XMLLogger(outStream, OutputStreamOptions.CLOSE); + logger.finishLocalSetup(); + logger.auditStarted(null); +@@ -338,7 +338,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + + /** We keep this test for 100% coverage. Until #12873. */ + @Test +- public void testCtorWithTwoParametersCloseStreamOptions() { ++ void ctorWithTwoParametersCloseStreamOptions() { + final XMLLogger logger = new XMLLogger(outStream, AutomaticBean.OutputStreamOptions.CLOSE); + final boolean closeStream = TestUtil.getInternalState(logger, "closeStream"); + +@@ -347,7 +347,7 @@ public class XMLLoggerTest extends AbstractXmlTestSupport { + + /** We keep this test for 100% coverage. Until #12873. */ + @Test +- public void testCtorWithTwoParametersNoneStreamOptions() { ++ void ctorWithTwoParametersNoneStreamOptions() { + final XMLLogger logger = new XMLLogger(outStream, AutomaticBean.OutputStreamOptions.NONE); + final boolean closeStream = TestUtil.getInternalState(logger, "closeStream"); + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java +index 502d58cd4..7353ef280 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/XdocsPropertyTypeTest.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; + + import com.puppycrawl.tools.checkstyle.checks.header.AbstractHeaderCheck; +@@ -28,14 +29,13 @@ import java.io.IOException; + import java.util.Arrays; + import java.util.Objects; + import java.util.Set; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + import org.junit.jupiter.api.Test; + +-public class XdocsPropertyTypeTest { ++final class XdocsPropertyTypeTest { + + @Test +- public void testAllPropertyTypesAreUsed() throws IOException { ++ void allPropertyTypesAreUsed() throws IOException { + final Set propertyTypes = + Stream.concat( + Stream.of(AbstractHeaderCheck.class, Checker.class), +@@ -45,7 +45,7 @@ public class XdocsPropertyTypeTest { + .map(field -> field.getAnnotation(XdocsPropertyType.class)) + .filter(Objects::nonNull) + .map(XdocsPropertyType::value) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + + assertWithMessage("All property types should be used") + .that(propertyTypes) +@@ -53,7 +53,7 @@ public class XdocsPropertyTypeTest { + } + + @Test +- public void testAllPropertyTypesHaveDescription() { ++ void allPropertyTypesHaveDescription() { + for (PropertyType value : PropertyType.values()) { + assertWithMessage("Property type '%s' has no description", value) + .that(CommonUtil.isBlank(value.getDescription())) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/XmlLoaderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/XmlLoaderTest.java +index d22713d76..480450f15 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/XmlLoaderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/XmlLoaderTest.java +@@ -30,10 +30,10 @@ import org.junit.jupiter.api.Test; + import org.xml.sax.SAXException; + import org.xml.sax.XMLReader; + +-public class XmlLoaderTest { ++final class XmlLoaderTest { + + @Test +- public void testParserConfiguredSuccessfully() throws Exception { ++ void parserConfiguredSuccessfully() throws Exception { + final DummyLoader dummyLoader = new DummyLoader(new HashMap<>(1)); + final XMLReader parser = TestUtil.getInternalState(dummyLoader, "parser"); + assertWithMessage("Invalid entity resolver") +@@ -42,14 +42,14 @@ public class XmlLoaderTest { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(XmlLoader.LoadExternalDtdFeatureProvider.class)) + .isTrue(); + } + + @Test +- public void testResolveEntityDefault() throws Exception { ++ void resolveEntityDefault() throws Exception { + final Map map = new HashMap<>(); + map.put("predefined", "/google.xml"); + final DummyLoader dummyLoader = new DummyLoader(map); +@@ -59,7 +59,7 @@ public class XmlLoaderTest { + } + + @Test +- public void testResolveEntityMap() throws Exception { ++ void resolveEntityMap() throws Exception { + final Map map = new HashMap<>(); + map.put("predefined", "/google.xml"); + final DummyLoader dummyLoader = new DummyLoader(map); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAstFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAstFilterTest.java +index 717395111..5fb8f8abe 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAstFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAstFilterTest.java +@@ -35,10 +35,10 @@ import java.nio.charset.StandardCharsets; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class XpathFileGeneratorAstFilterTest { ++final class XpathFileGeneratorAstFilterTest { + + @Test +- public void testAcceptNoToken() { ++ void acceptNoToken() { + final Violation violation = + new Violation( + 0, 0, 0, null, null, null, null, null, XpathFileGeneratorAstFilterTest.class, null); +@@ -56,7 +56,7 @@ public class XpathFileGeneratorAstFilterTest { + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + final Violation violation = + new Violation( + 3, +@@ -87,7 +87,7 @@ public class XpathFileGeneratorAstFilterTest { + } + + @Test +- public void testNoXpathQuery() throws Exception { ++ void noXpathQuery() throws Exception { + final Violation violation = + new Violation( + 10, +@@ -116,7 +116,7 @@ public class XpathFileGeneratorAstFilterTest { + } + + @Test +- public void testTabWidth() throws Exception { ++ void tabWidth() throws Exception { + final Violation violation = + new Violation( + 6, +@@ -154,9 +154,9 @@ public class XpathFileGeneratorAstFilterTest { + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearState() throws Exception { ++ @Test ++ void clearState() throws Exception { + final Violation violation = + new Violation( + 3, +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListenerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListenerTest.java +index 6bc7c06e0..d50a31886 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListenerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/XpathFileGeneratorAuditListenerTest.java +@@ -41,7 +41,7 @@ import java.io.OutputStream; + import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.Test; + +-public class XpathFileGeneratorAuditListenerTest { ++final class XpathFileGeneratorAuditListenerTest { + + /** OS specific line separator. */ + private static final String EOL = System.getProperty("line.separator"); +@@ -90,7 +90,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testFinishLocalSetup() { ++ void finishLocalSetup() { + final OutputStream out = new ByteArrayOutputStream(); + final XpathFileGeneratorAuditListener listener = + new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); +@@ -103,7 +103,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testFileStarted() { ++ void fileStarted() { + final OutputStream out = new ByteArrayOutputStream(); + final XpathFileGeneratorAuditListener listener = + new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); +@@ -115,7 +115,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testFileFinished() { ++ void fileFinished() { + final OutputStream out = new ByteArrayOutputStream(); + final XpathFileGeneratorAuditListener listener = + new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); +@@ -127,7 +127,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testAddException() { ++ void addException() { + final OutputStream out = new ByteArrayOutputStream(); + final XpathFileGeneratorAuditListener logger = + new XpathFileGeneratorAuditListener(out, OutputStreamOptions.CLOSE); +@@ -147,7 +147,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testCorrectOne() { ++ void correctOne() { + final AuditEvent event = + createAuditEvent("InputXpathFileGeneratorAuditListener.java", FIRST_MESSAGE); + +@@ -180,7 +180,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testCorrectTwo() { ++ void correctTwo() { + final AuditEvent event1 = + createAuditEvent("InputXpathFileGeneratorAuditListener.java", SECOND_MESSAGE); + +@@ -227,7 +227,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testOnlyOneMatching() { ++ void onlyOneMatching() { + final AuditEvent event1 = + createAuditEvent( + "InputXpathFileGeneratorAuditListener.java", 10, 5, MethodParamPadCheck.class); +@@ -268,7 +268,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testCloseStream() { ++ void closeStream() { + final XpathFileGeneratorAuditListener listener = + new XpathFileGeneratorAuditListener(outStream, OutputStreamOptions.CLOSE); + listener.finishLocalSetup(); +@@ -279,7 +279,7 @@ public class XpathFileGeneratorAuditListenerTest { + } + + @Test +- public void testNoCloseStream() { ++ void noCloseStream() { + final XpathFileGeneratorAuditListener listener = + new XpathFileGeneratorAuditListener(outStream, OutputStreamOptions.NONE); + listener.finishLocalSetup(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTaskTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTaskTest.java +index 72b8ecdc5..48034dfc1 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTaskTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/ant/CheckstyleAntTaskTest.java +@@ -20,6 +20,7 @@ + package com.puppycrawl.tools.checkstyle.ant; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + import static org.junit.jupiter.api.Assertions.assertThrows; + + import com.google.common.truth.StandardSubjectBuilder; +@@ -35,7 +36,6 @@ import com.puppycrawl.tools.checkstyle.internal.testmodules.TestRootModuleChecke + import java.io.File; + import java.io.IOException; + import java.net.URL; +-import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.util.Arrays; + import java.util.List; +@@ -52,7 +52,7 @@ import org.apache.tools.ant.types.Path; + import org.apache.tools.ant.types.resources.FileResource; + import org.junit.jupiter.api.Test; + +-public class CheckstyleAntTaskTest extends AbstractPathTestSupport { ++final class CheckstyleAntTaskTest extends AbstractPathTestSupport { + + private static final String FLAWLESS_INPUT = "InputCheckstyleAntTaskFlawless.java"; + private static final String VIOLATED_INPUT = "InputCheckstyleAntTaskError.java"; +@@ -80,7 +80,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testDefaultFlawless() throws IOException { ++ final void defaultFlawless() throws IOException { + TestRootModuleChecker.reset(); + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); + antTask.setFile(new File(getPath(FLAWLESS_INPUT))); +@@ -92,7 +92,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testPathsOneFile() throws IOException { ++ final void pathsOneFile() throws IOException { + // given + TestRootModuleChecker.reset(); + +@@ -118,7 +118,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testPathsFileWithLogVerification() throws IOException { ++ final void pathsFileWithLogVerification() throws IOException { + // given + TestRootModuleChecker.reset(); + final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); +@@ -169,7 +169,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testPathsDirectoryWithNestedFile() throws IOException { ++ final void pathsDirectoryWithNestedFile() throws IOException { + // given + TestRootModuleChecker.reset(); + +@@ -200,7 +200,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testCustomRootModule() throws IOException { ++ final void customRootModule() throws IOException { + TestRootModuleChecker.reset(); + + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); +@@ -213,7 +213,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testFileSet() throws IOException { ++ final void fileSet() throws IOException { + TestRootModuleChecker.reset(); + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); + final FileSet examinationFileSet = new FileSet(); +@@ -232,7 +232,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testNoConfigFile() throws IOException { ++ final void noConfigFile() throws IOException { + final CheckstyleAntTask antTask = new CheckstyleAntTask(); + antTask.setProject(new Project()); + antTask.setFile(new File(getPath(FLAWLESS_INPUT))); +@@ -244,7 +244,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testNonExistentConfig() throws IOException { ++ final void nonExistentConfig() throws IOException { + final CheckstyleAntTask antTask = new CheckstyleAntTask(); + antTask.setConfig(getPath(NOT_EXISTING_FILE)); + antTask.setProject(new Project()); +@@ -257,7 +257,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testEmptyConfigFile() throws IOException { ++ final void emptyConfigFile() throws IOException { + final CheckstyleAntTask antTask = new CheckstyleAntTask(); + antTask.setConfig(getPath("InputCheckstyleAntTaskEmptyConfig.xml")); + antTask.setProject(new Project()); +@@ -270,7 +270,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testNoFile() throws IOException { ++ final void noFile() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + final BuildException ex = + assertThrows(BuildException.class, antTask::execute, "BuildException is expected"); +@@ -280,7 +280,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testMaxWarningExceeded() throws IOException { ++ final void maxWarningExceeded() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(WARNING_INPUT))); + antTask.setMaxWarnings(0); +@@ -292,7 +292,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testMaxErrors() throws IOException { ++ final void maxErrors() throws IOException { + TestRootModuleChecker.reset(); + + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); +@@ -306,7 +306,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testFailureProperty() throws IOException { ++ final void failureProperty() throws IOException { + final CheckstyleAntTask antTask = new CheckstyleAntTask(); + antTask.setConfig(getPath(CONFIG_FILE)); + antTask.setFile(new File(getPath(VIOLATED_INPUT))); +@@ -330,7 +330,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testOverrideProperty() throws IOException { ++ final void overrideProperty() throws IOException { + TestRootModuleChecker.reset(); + + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); +@@ -347,7 +347,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testExecuteIgnoredModules() throws IOException { ++ final void executeIgnoredModules() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(VIOLATED_INPUT))); + antTask.setFailOnViolation(false); +@@ -390,7 +390,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testConfigurationByUrl() throws IOException { ++ final void configurationByUrl() throws IOException { + final CheckstyleAntTask antTask = new CheckstyleAntTask(); + antTask.setProject(new Project()); + final URL url = new File(getPath(CONFIG_FILE)).toURI().toURL(); +@@ -414,7 +414,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testConfigurationByResource() throws IOException { ++ final void configurationByResource() throws IOException { + final CheckstyleAntTask antTask = new CheckstyleAntTask(); + antTask.setProject(new Project()); + antTask.setConfig(getPath(CONFIG_FILE)); +@@ -437,7 +437,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testSimultaneousConfiguration() throws IOException { ++ final void simultaneousConfiguration() throws IOException { + final File file = new File(getPath(CONFIG_FILE)); + final URL url = file.toURI().toURL(); + +@@ -453,7 +453,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testSetPropertiesFile() throws IOException { ++ final void setPropertiesFile() throws IOException { + TestRootModuleChecker.reset(); + + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); +@@ -467,7 +467,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testSetPropertiesNonExistentFile() throws IOException { ++ final void setPropertiesNonExistentFile() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(FLAWLESS_INPUT))); + antTask.setProperties(new File(getPath(NOT_EXISTING_FILE))); +@@ -479,7 +479,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testXmlOutput() throws IOException { ++ final void xmlOutput() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(VIOLATED_INPUT))); + antTask.setFailOnViolation(false); +@@ -506,7 +506,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testSarifOutput() throws IOException { ++ final void sarifOutput() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(VIOLATED_INPUT))); + antTask.setFailOnViolation(false); +@@ -538,7 +538,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testCreateListenerException() throws IOException { ++ final void createListenerException() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(FLAWLESS_INPUT))); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -553,7 +553,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testCreateListenerExceptionWithXmlLogger() throws IOException { ++ final void createListenerExceptionWithXmlLogger() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(FLAWLESS_INPUT))); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -571,7 +571,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testCreateListenerExceptionWithSarifLogger() throws IOException { ++ final void createListenerExceptionWithSarifLogger() throws IOException { + final CheckstyleAntTask antTask = getCheckstyleAntTask(); + antTask.setFile(new File(getPath(FLAWLESS_INPUT))); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -589,7 +589,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testSetInvalidType() { ++ void setInvalidType() { + final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); + final BuildException ex = + assertThrows( +@@ -602,7 +602,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testSetFileValueByFile() throws IOException { ++ void setFileValueByFile() throws IOException { + final String filename = getPath("InputCheckstyleAntTaskCheckstyleAntTest.properties"); + final CheckstyleAntTask.Property property = new CheckstyleAntTask.Property(); + property.setFile(new File(filename)); +@@ -612,7 +612,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testDefaultLoggerListener() throws IOException { ++ void defaultLoggerListener() throws IOException { + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); + formatter.setUseFile(false); + assertWithMessage("Listener instance has unexpected type") +@@ -621,7 +621,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testDefaultLoggerListenerWithToFile() throws IOException { ++ void defaultLoggerListenerWithToFile() throws IOException { + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); + formatter.setUseFile(false); + formatter.setTofile(new File("target/")); +@@ -631,7 +631,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testXmlLoggerListener() throws IOException { ++ void xmlLoggerListener() throws IOException { + final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); + formatterType.setValue("xml"); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -643,7 +643,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testXmlLoggerListenerWithToFile() throws IOException { ++ void xmlLoggerListenerWithToFile() throws IOException { + final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); + formatterType.setValue("xml"); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -656,7 +656,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testDefaultLoggerWithNullToFile() throws IOException { ++ void defaultLoggerWithNullToFile() throws IOException { + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); + formatter.setTofile(null); + assertWithMessage("Listener instance has unexpected type") +@@ -665,7 +665,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testXmlLoggerWithNullToFile() throws IOException { ++ void xmlLoggerWithNullToFile() throws IOException { + final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); + formatterType.setValue("xml"); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -677,7 +677,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testSarifLoggerListener() throws IOException { ++ void sarifLoggerListener() throws IOException { + final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); + formatterType.setValue("sarif"); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -689,7 +689,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testSarifLoggerListenerWithToFile() throws IOException { ++ void sarifLoggerListenerWithToFile() throws IOException { + final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); + formatterType.setValue("sarif"); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -702,7 +702,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testSarifLoggerWithNullToFile() throws IOException { ++ void sarifLoggerWithNullToFile() throws IOException { + final CheckstyleAntTask.FormatterType formatterType = new CheckstyleAntTask.FormatterType(); + formatterType.setValue("sarif"); + final CheckstyleAntTask.Formatter formatter = new CheckstyleAntTask.Formatter(); +@@ -715,14 +715,14 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + + /** Testing deprecated method. */ + @Test +- public void testCreateClasspath() { ++ void createClasspath() { + final CheckstyleAntTask antTask = new CheckstyleAntTask(); + + assertWithMessage("Invalid classpath").that(antTask.createClasspath().toString()).isEmpty(); + } + + @Test +- public void testDestroyed() throws IOException { ++ void destroyed() throws IOException { + TestRootModuleChecker.reset(); + + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); +@@ -736,7 +736,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testMaxWarnings() throws IOException { ++ void maxWarnings() throws IOException { + TestRootModuleChecker.reset(); + + final CheckstyleAntTask antTask = getCheckstyleAntTask(CUSTOM_ROOT_CONFIG_FILE); +@@ -750,7 +750,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public final void testExecuteLogOutput() throws Exception { ++ final void executeLogOutput() throws Exception { + final URL url = new File(getPath(CONFIG_FILE)).toURI().toURL(); + final ResourceBundle bundle = + ResourceBundle.getBundle(Definitions.CHECKSTYLE_BUNDLE, Locale.ROOT); +@@ -795,7 +795,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testCheckerException() throws IOException { ++ void checkerException() throws IOException { + final CheckstyleAntTask antTask = new CheckstyleAntTaskStub(); + antTask.setConfig(getPath(CONFIG_FILE)); + antTask.setProject(new Project()); +@@ -809,7 +809,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoggedTime() throws IOException { ++ void loggedTime() throws IOException { + final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); + antTask.setConfig(getPath(CONFIG_FILE)); + antTask.setProject(new Project()); +@@ -835,7 +835,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + .that(optionalMessageLevelPair.isPresent()) + .isTrue(); + +- final long actualTime = getNumberFromLine(optionalMessageLevelPair.get().getMsg()); ++ final long actualTime = getNumberFromLine(optionalMessageLevelPair.orElseThrow().getMsg()); + + assertWithMessage( + "Logged time in '" + expectedMsg + "' " + "must be less than the testing time") +@@ -844,7 +844,7 @@ public class CheckstyleAntTaskTest extends AbstractPathTestSupport { + } + + private static List readWholeFile(File outputFile) throws IOException { +- return Files.readAllLines(outputFile.toPath(), StandardCharsets.UTF_8); ++ return Files.readAllLines(outputFile.toPath(), UTF_8); + } + + private static long getNumberFromLine(String line) { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractCheckTest.java +index 2864f114e..94f76f079 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractCheckTest.java +@@ -20,8 +20,9 @@ + package com.puppycrawl.tools.checkstyle.api; + + import static com.google.common.truth.Truth.assertWithMessage; +-import static org.junit.jupiter.api.Assertions.assertThrows; ++import static org.assertj.core.api.Assertions.assertThatThrownBy; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.DetailAstImpl; +@@ -29,7 +30,6 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import java.nio.charset.Charset; + import java.util.Arrays; +-import java.util.Collections; + import java.util.HashMap; + import java.util.Iterator; + import java.util.Map; +@@ -37,7 +37,7 @@ import java.util.Set; + import java.util.SortedSet; + import org.junit.jupiter.api.Test; + +-public class AbstractCheckTest extends AbstractModuleTestSupport { ++final class AbstractCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -45,7 +45,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -70,7 +70,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptable() { ++ void getAcceptable() { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -95,7 +95,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentNodes() { ++ void commentNodes() { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -118,7 +118,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokenNames() { ++ void tokenNames() { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -144,7 +144,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitToken() { ++ void visitToken() { + final VisitCounterCheck check = new VisitCounterCheck(); + // Eventually it will become clear abstract method + check.visitToken(null); +@@ -153,7 +153,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetLine() throws Exception { ++ void getLine() throws Exception { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -181,7 +181,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetLineCodePoints() throws Exception { ++ void getLineCodePoints() throws Exception { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -213,7 +213,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetTabWidth() { ++ void getTabWidth() { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -238,7 +238,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileContents() { ++ void fileContents() { + final AbstractCheck check = + new AbstractCheck() { + @Override +@@ -268,7 +268,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final int[] defaultTokens = {TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF}; + final int[] acceptableTokens = {TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF}; + final int[] requiredTokens = {TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF}; +@@ -302,7 +302,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearViolations() { ++ void clearViolations() { + final AbstractCheck check = new DummyAbstractCheck(); + + check.log(1, "key", "args"); +@@ -312,11 +312,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineColumnLog() throws Exception { ++ void lineColumnLog() throws Exception { + final ViolationCheck check = new ViolationCheck(); + check.configure(new DefaultConfiguration("check")); + final File file = new File("fileName"); +- final FileText theText = new FileText(file, Collections.singletonList("test123")); ++ final FileText theText = new FileText(file, ImmutableList.of("test123")); + + check.setFileContents(new FileContents(theText)); + check.clearViolations(); +@@ -338,11 +338,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAstLog() throws Exception { ++ void astLog() throws Exception { + final ViolationAstCheck check = new ViolationAstCheck(); + check.configure(new DefaultConfiguration("check")); + final File file = new File("fileName"); +- final FileText theText = new FileText(file, Collections.singletonList("test123")); ++ final FileText theText = new FileText(file, ImmutableList.of("test123")); + + check.setFileContents(new FileContents(theText)); + check.clearViolations(); +@@ -362,7 +362,7 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheck() throws Exception { ++ void check() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ViolationAstCheck.class); + + final String[] expected = { +@@ -377,10 +377,11 @@ public class AbstractCheckTest extends AbstractModuleTestSupport { + * file as none of the checks try to modify the tokens. + */ + @Test +- public void testTokensAreUnmodifiable() { ++ void tokensAreUnmodifiable() { + final DummyAbstractCheck check = new DummyAbstractCheck(); + final Set tokenNameSet = check.getTokenNames(); +- assertThrows(UnsupportedOperationException.class, () -> tokenNameSet.add("")); ++ assertThatThrownBy(() -> tokenNameSet.add("")) ++ .isInstanceOf(UnsupportedOperationException.class); + } + + public static final class DummyAbstractCheck extends AbstractCheck { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheckTest.java +index 9d239f38d..1c635ecdd 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractFileSetCheckTest.java +@@ -21,19 +21,19 @@ package com.puppycrawl.tools.checkstyle.api; + + import static com.google.common.truth.Truth.assertWithMessage; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.Checker; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import java.io.File; + import java.nio.charset.StandardCharsets; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import java.util.SortedSet; + import java.util.TreeSet; + import org.junit.jupiter.api.Test; + +-public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { ++final class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,17 +41,17 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTabWidth() { ++ void tabWidth() { + final DummyFileSetCheck check = new DummyFileSetCheck(); + check.setTabWidth(12345); + assertWithMessage("expected tab width").that(check.getTabWidth()).isEqualTo(12345); + } + + @Test +- public void testFileContents() { ++ void fileContents() { + final FileContents contents = + new FileContents( +- new FileText(new File("inputAbstractFileSetCheck.tmp"), Collections.emptyList())); ++ new FileText(new File("inputAbstractFileSetCheck.tmp"), ImmutableList.of())); + final DummyFileSetCheck check = new DummyFileSetCheck(); + check.setFileContents(contents); + assertWithMessage("expected file contents") +@@ -60,13 +60,13 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessSequential() throws Exception { ++ void processSequential() throws Exception { + final DummyFileSetCheck check = new DummyFileSetCheck(); + check.configure(new DefaultConfiguration("filesetcheck")); + check.setFileExtensions("tmp"); + final File firstFile = new File("inputAbstractFileSetCheck.tmp"); + final SortedSet firstFileMessages = +- check.process(firstFile, new FileText(firstFile, Collections.emptyList())); ++ check.process(firstFile, new FileText(firstFile, ImmutableList.of())); + + assertWithMessage("Invalid message") + .that(firstFileMessages.first().getViolation()) +@@ -86,25 +86,25 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotProcessed() throws Exception { ++ void notProcessed() throws Exception { + final ExceptionFileSetCheck check = new ExceptionFileSetCheck(); + check.setFileExtensions("java"); + final File firstFile = new File("inputAbstractFileSetCheck.tmp"); + +- check.process(firstFile, new FileText(firstFile, Collections.emptyList())); ++ check.process(firstFile, new FileText(firstFile, ImmutableList.of())); + + final SortedSet internalMessages = check.getViolations(); + assertWithMessage("Internal message should be empty").that(internalMessages).isEmpty(); + } + + @Test +- public void testProcessException() throws Exception { ++ void processException() throws Exception { + final ExceptionFileSetCheck check = new ExceptionFileSetCheck(); + check.configure(new DefaultConfiguration("filesetcheck")); + check.setFileExtensions("tmp"); + final File firstFile = new File("inputAbstractFileSetCheck.tmp"); + +- final FileText fileText = new FileText(firstFile, Collections.emptyList()); ++ final FileText fileText = new FileText(firstFile, ImmutableList.of()); + try { + check.process(firstFile, fileText); + assertWithMessage("Exception is expected").fail(); +@@ -118,7 +118,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + + // again to prove only 1 violation exists + final File secondFile = new File("inputAbstractFileSetCheck.tmp"); +- final FileText fileText2 = new FileText(secondFile, Collections.emptyList()); ++ final FileText fileText2 = new FileText(secondFile, ImmutableList.of()); + try { + check.process(secondFile, fileText2); + assertWithMessage("Exception is expected").fail(); +@@ -134,7 +134,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetFileExtension() { ++ void getFileExtension() { + final DummyFileSetCheck check = new DummyFileSetCheck(); + check.setFileExtensions("tmp", ".java"); + final String[] expectedExtensions = {".tmp", ".java"}; +@@ -146,7 +146,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + + /** This javadoc exists only to suppress IntelliJ IDEA inspection. */ + @Test +- public void testSetExtensionThrowsExceptionWhenTheyAreNull() { ++ void setExtensionThrowsExceptionWhenTheyAreNull() { + final DummyFileSetCheck check = new DummyFileSetCheck(); + try { + check.setFileExtensions((String[]) null); +@@ -159,7 +159,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineColumnLog() throws Exception { ++ void lineColumnLog() throws Exception { + final ViolationFileSetCheck check = new ViolationFileSetCheck(); + check.configure(new DefaultConfiguration("filesetcheck")); + final File file = new File(getPath("InputAbstractFileSetLineColumn.txt")); +@@ -174,7 +174,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetMessageDispatcher() { ++ void getMessageDispatcher() { + final DummyFileSetCheck check = new DummyFileSetCheck(); + final Checker checker = new Checker(); + check.setMessageDispatcher(checker); +@@ -185,7 +185,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheck() throws Exception { ++ void check() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ViolationFileSetCheck.class); + + final String[] expected = { +@@ -195,7 +195,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiFileFireErrors() throws Exception { ++ void multiFileFireErrors() throws Exception { + final MultiFileViolationFileSetCheck check = new MultiFileViolationFileSetCheck(); + check.configure(new DefaultConfiguration("filesetcheck")); + final ViolationDispatcher dispatcher = new ViolationDispatcher(); +@@ -229,7 +229,7 @@ public class AbstractFileSetCheckTest extends AbstractModuleTestSupport { + * as none of the checks try to modify the fileExtensions. + */ + @Test +- public void testCopiedArrayIsReturned() { ++ void copiedArrayIsReturned() { + final DummyFileSetCheck check = new DummyFileSetCheck(); + check.setFileExtensions(".tmp"); + assertWithMessage("Extensions should be copied") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporterTest.java +index 2abec77c1..3390e0d5c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AbstractViolationReporterTest.java +@@ -28,7 +28,7 @@ import java.util.SortedSet; + import org.junit.jupiter.api.Test; + + /** Tests to ensure that default message bundle is determined correctly. */ +-public class AbstractViolationReporterTest { ++final class AbstractViolationReporterTest { + + private final AbstractCheck emptyCheck = new EmptyCheck(); + +@@ -37,7 +37,7 @@ public class AbstractViolationReporterTest { + } + + @Test +- public void testGetMessageBundleWithPackage() throws Exception { ++ void getMessageBundleWithPackage() throws Exception { + assertWithMessage("violation bundle differs from expected") + .that( + TestUtil.invokeStaticMethod( +@@ -48,7 +48,7 @@ public class AbstractViolationReporterTest { + } + + @Test +- public void testGetMessageBundleWithoutPackage() throws Exception { ++ void getMessageBundleWithoutPackage() throws Exception { + assertWithMessage("violation bundle differs from expected") + .that( + TestUtil.invokeStaticMethod( +@@ -57,13 +57,13 @@ public class AbstractViolationReporterTest { + } + + @Test +- public void testCustomId() { ++ void customId() { + emptyCheck.setId("MyId"); + assertWithMessage("Id differs from expected").that(emptyCheck.getId()).isEqualTo("MyId"); + } + + @Test +- public void testSeverity() throws Exception { ++ void severity() throws Exception { + final DefaultConfiguration config = createModuleConfig(emptyCheck.getClass()); + config.addMessage("severity", "error"); + emptyCheck.configure(config); +@@ -75,7 +75,7 @@ public class AbstractViolationReporterTest { + } + + @Test +- public void testCustomMessage() throws Exception { ++ void customMessage() throws Exception { + final DefaultConfiguration config = createModuleConfig(emptyCheck.getClass()); + config.addMessage("msgKey", "This is a custom violation."); + emptyCheck.configure(config); +@@ -91,7 +91,7 @@ public class AbstractViolationReporterTest { + } + + @Test +- public void testCustomMessageWithParameters() throws Exception { ++ void customMessageWithParameters() throws Exception { + final DefaultConfiguration config = createModuleConfig(emptyCheck.getClass()); + config.addMessage("msgKey", "This is a custom violation with {0}."); + emptyCheck.configure(config); +@@ -107,7 +107,7 @@ public class AbstractViolationReporterTest { + } + + @Test +- public void testCustomMessageWithParametersNegative() throws Exception { ++ void customMessageWithParametersNegative() throws Exception { + final DefaultConfiguration config = createModuleConfig(emptyCheck.getClass()); + config.addMessage("msgKey", "This is a custom violation {0."); + emptyCheck.configure(config); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/AuditEventTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/AuditEventTest.java +index 19f8fa6b4..bfc4c2721 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/AuditEventTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/AuditEventTest.java +@@ -24,10 +24,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; + + import org.junit.jupiter.api.Test; + +-public class AuditEventTest { ++final class AuditEventTest { + + @Test +- public void test() { ++ void test() { + final AuditEvent event = new AuditEvent(getClass()); + + assertWithMessage("invalid file name").that(event.getFileName()).isNull(); +@@ -39,7 +39,7 @@ public class AuditEventTest { + } + + @Test +- public void testNoSource() { ++ void noSource() { + final IllegalArgumentException ex = + assertThrows( + IllegalArgumentException.class, +@@ -49,7 +49,7 @@ public class AuditEventTest { + } + + @Test +- public void testFullConstructor() { ++ void fullConstructor() { + final Violation message = + new Violation( + 1, +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSetTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSetTest.java +index c4d6640d6..802a991d7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSetTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/BeforeExecutionFileFilterSetTest.java +@@ -20,17 +20,17 @@ + package com.puppycrawl.tools.checkstyle.api; + + import static com.google.common.truth.Truth.assertWithMessage; +-import static org.junit.jupiter.api.Assertions.assertThrows; ++import static org.assertj.core.api.Assertions.assertThatThrownBy; + + import com.puppycrawl.tools.checkstyle.filefilters.BeforeExecutionExclusionFileFilter; + import java.util.Set; + import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; + +-public class BeforeExecutionFileFilterSetTest { ++final class BeforeExecutionFileFilterSetTest { + + @Test +- public void testRemoveFilters() { ++ void removeFilters() { + final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); + final BeforeExecutionFileFilter filter = new BeforeExecutionExclusionFileFilter(); + filterSet.addBeforeExecutionFileFilter(filter); +@@ -39,7 +39,7 @@ public class BeforeExecutionFileFilterSetTest { + } + + @Test +- public void testAccept() { ++ void accept() { + final String fileName = "BAD"; + final BeforeExecutionExclusionFileFilter filter = new BeforeExecutionExclusionFileFilter(); + filter.setFileNamePattern(Pattern.compile(fileName)); +@@ -52,7 +52,7 @@ public class BeforeExecutionFileFilterSetTest { + } + + @Test +- public void testReject() { ++ void reject() { + final String fileName = "Test"; + final BeforeExecutionExclusionFileFilter filter = new BeforeExecutionExclusionFileFilter(); + filter.setFileNamePattern(Pattern.compile(fileName)); +@@ -65,7 +65,7 @@ public class BeforeExecutionFileFilterSetTest { + } + + @Test +- public void testGetFilters2() { ++ void getFilters2() { + final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); + filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter()); + assertWithMessage("size is the same") +@@ -74,14 +74,14 @@ public class BeforeExecutionFileFilterSetTest { + } + + @Test +- public void testToString2() { ++ void toString2() { + final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); + filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter()); + assertWithMessage("size is the same").that(filterSet.toString()).isNotNull(); + } + + @Test +- public void testClear() { ++ void clear() { + final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); + filterSet.addBeforeExecutionFileFilter(new BeforeExecutionExclusionFileFilter()); + +@@ -102,12 +102,13 @@ public class BeforeExecutionFileFilterSetTest { + done for the time being + */ + @Test +- public void testUnmodifiableSet() { ++ void unmodifiableSet() { + final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); + final BeforeExecutionFileFilter filter = new BeforeExecutionExclusionFileFilter(); + filterSet.addBeforeExecutionFileFilter(filter); + final Set excFilterSet = filterSet.getBeforeExecutionFileFilters(); +- assertThrows(UnsupportedOperationException.class, () -> excFilterSet.add(filter)); ++ assertThatThrownBy(() -> excFilterSet.add(filter)) ++ .isInstanceOf(UnsupportedOperationException.class); + } + + /* +@@ -115,7 +116,7 @@ public class BeforeExecutionFileFilterSetTest { + useful for third party integrations. + */ + @Test +- public void testEmptyToString() { ++ void emptyToString() { + final BeforeExecutionFileFilterSet filterSet = new BeforeExecutionFileFilterSet(); + assertWithMessage("toString() result shouldn't be an empty string") + .that(filterSet.toString()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/CommentTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/CommentTest.java +index 16ed17eea..9b43176bb 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/CommentTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/CommentTest.java +@@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; + + import org.junit.jupiter.api.Test; + +-public class CommentTest { ++final class CommentTest { + + @Test +- public void test() { ++ void test() { + final String[] text = {"test"}; + final Comment comment = new Comment(text, 1, 2, 3); + +@@ -42,7 +42,7 @@ public class CommentTest { + } + + @Test +- public void testIntersects() { ++ void intersects() { + final String[] text = {"test", "test"}; + final Comment comment = new Comment(text, 2, 4, 4); + +@@ -55,7 +55,7 @@ public class CommentTest { + } + + @Test +- public void testIntersects2() { ++ void intersects2() { + final String[] text = {"a"}; + final Comment comment = new Comment(text, 2, 2, 2); + +@@ -63,7 +63,7 @@ public class CommentTest { + } + + @Test +- public void testIntersects3() { ++ void intersects3() { + final String[] text = {"test"}; + final Comment comment = new Comment(text, 1, 1, 2); + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileContentsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileContentsTest.java +index bc25d638c..425bd9264 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileContentsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileContentsTest.java +@@ -21,19 +21,19 @@ package com.puppycrawl.tools.checkstyle.api; + + import static com.google.common.truth.Truth.assertWithMessage; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.HashMap; + import java.util.List; + import java.util.Map; + import org.junit.jupiter.api.Test; + +-public class FileContentsTest { ++final class FileContentsTest { + + @Test +- public void testTextFileName() { ++ void textFileName() { + final FileContents fileContents = + new FileContents(new FileText(new File("filename"), Arrays.asList("123", "456"))); + +@@ -47,36 +47,35 @@ public class FileContentsTest { + } + + @Test +- public void testIsLineBlank() { ++ void isLineBlank() { + assertWithMessage("Invalid result") + .that( +- new FileContents(new FileText(new File("filename"), Collections.singletonList("123"))) ++ new FileContents(new FileText(new File("filename"), ImmutableList.of("123"))) + .lineIsBlank(0)) + .isFalse(); + assertWithMessage("Invalid result") + .that( +- new FileContents(new FileText(new File("filename"), Collections.singletonList(""))) ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(""))) + .lineIsBlank(0)) + .isTrue(); + } + + @Test +- public void testLineIsComment() { ++ void lineIsComment() { + assertWithMessage("Invalid result") + .that( +- new FileContents(new FileText(new File("filename"), Collections.singletonList("123"))) ++ new FileContents(new FileText(new File("filename"), ImmutableList.of("123"))) + .lineIsComment(0)) + .isFalse(); + assertWithMessage("Invalid result") + .that( +- new FileContents( +- new FileText(new File("filename"), Collections.singletonList(" // abc"))) ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" // abc"))) + .lineIsComment(0)) + .isTrue(); + } + + @Test +- public void testDeprecatedAbbreviatedMethod() { ++ void deprecatedAbbreviatedMethod() { + // just to make UT coverage 100% + final FileContents fileContents = + new FileContents(new FileText(new File("filename"), Arrays.asList("123", "456"))); +@@ -92,10 +91,10 @@ public class FileContentsTest { + } + + @Test +- public void testSinglelineCommentNotIntersect() { ++ void singlelineCommentNotIntersect() { + // just to make UT coverage 100% + final FileContents fileContents = +- new FileContents(new FileText(new File("filename"), Collections.singletonList(" // "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" // "))); + fileContents.reportSingleLineComment(1, 2); + assertWithMessage("Should return false when there is no intersection") + .that(fileContents.hasIntersectionWithComment(1, 0, 1, 1)) +@@ -103,10 +102,10 @@ public class FileContentsTest { + } + + @Test +- public void testSinglelineCommentIntersect() { ++ void singlelineCommentIntersect() { + // just to make UT coverage 100% + final FileContents fileContents = +- new FileContents(new FileText(new File("filename"), Collections.singletonList(" // "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" // "))); + fileContents.reportSingleLineComment("type", 1, 2); + assertWithMessage("Should return true when comments intersect") + .that(fileContents.hasIntersectionWithComment(1, 5, 1, 6)) +@@ -114,9 +113,9 @@ public class FileContentsTest { + } + + @Test +- public void testReportCppComment() { ++ void reportCppComment() { + final FileContents fileContents = +- new FileContents(new FileText(new File("filename"), Collections.singletonList(" // "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" // "))); + fileContents.reportSingleLineComment(1, 2); + final Map cppComments = fileContents.getSingleLineComments(); + +@@ -126,7 +125,7 @@ public class FileContentsTest { + } + + @Test +- public void testHasIntersectionWithSingleLineComment() { ++ void hasIntersectionWithSingleLineComment() { + final FileContents fileContents = + new FileContents( + new FileText( +@@ -140,9 +139,9 @@ public class FileContentsTest { + } + + @Test +- public void testReportComment() { ++ void reportComment() { + final FileContents fileContents = +- new FileContents(new FileText(new File("filename"), Collections.singletonList(" // "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" // "))); + fileContents.reportBlockComment("type", 1, 2, 1, 2); + final Map> comments = fileContents.getBlockComments(); + +@@ -152,10 +151,9 @@ public class FileContentsTest { + } + + @Test +- public void testReportBlockCommentSameLine() { ++ void reportBlockCommentSameLine() { + final FileContents fileContents = +- new FileContents( +- new FileText(new File("filename"), Collections.singletonList("/* a */ /* b */ "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of("/* a */ /* b */ "))); + fileContents.reportBlockComment("type", 1, 0, 1, 6); + fileContents.reportBlockComment("type", 1, 8, 1, 14); + final Map> comments = fileContents.getBlockComments(); +@@ -170,7 +168,7 @@ public class FileContentsTest { + } + + @Test +- public void testReportBlockCommentMultiLine() { ++ void reportBlockCommentMultiLine() { + final FileContents fileContents = + new FileContents(new FileText(new File("filename"), Arrays.asList("/*", "c", "*/"))); + fileContents.reportBlockComment("type", 1, 0, 3, 1); +@@ -179,12 +177,11 @@ public class FileContentsTest { + assertWithMessage("Invalid comment") + .that(comments.get(1).toString()) + .isEqualTo( +- Collections.singletonList(new Comment(new String[] {"/*", "c", "*/"}, 0, 3, 1)) +- .toString()); ++ ImmutableList.of(new Comment(new String[] {"/*", "c", "*/"}, 0, 3, 1)).toString()); + } + + @Test +- public void testReportBlockCommentJavadoc() { ++ void reportBlockCommentJavadoc() { + final FileContents fileContents = + new FileContents( + new FileText( +@@ -202,7 +199,7 @@ public class FileContentsTest { + } + + @Test +- public void testHasIntersectionWithBlockComment() { ++ void hasIntersectionWithBlockComment() { + final FileContents fileContents = + new FileContents( + new FileText( +@@ -217,7 +214,7 @@ public class FileContentsTest { + } + + @Test +- public void testHasIntersectionWithBlockComment2() { ++ void hasIntersectionWithBlockComment2() { + final FileContents fileContents = + new FileContents( + new FileText(new File("filename"), Arrays.asList(" /* */ ", " ", " "))); +@@ -229,10 +226,9 @@ public class FileContentsTest { + } + + @Test +- public void testReportJavadocComment() { ++ void reportJavadocComment() { + final FileContents fileContents = +- new FileContents( +- new FileText(new File("filename"), Collections.singletonList(" /** */ "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" /** */ "))); + fileContents.reportBlockComment(1, 2, 1, 6); + final TextBlock comment = fileContents.getJavadocBefore(2); + +@@ -242,10 +238,9 @@ public class FileContentsTest { + } + + @Test +- public void testReportJavadocComment2() { ++ void reportJavadocComment2() { + final FileContents fileContents = +- new FileContents( +- new FileText(new File("filename"), Collections.singletonList(" /** */ "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" /** */ "))); + fileContents.reportBlockComment(1, 2, 1, 6); + final TextBlock comment = fileContents.getJavadocBefore(2); + +@@ -260,10 +255,9 @@ public class FileContentsTest { + */ + @Deprecated(since = "10.2") + @Test +- public void testInPackageInfo() { ++ void inPackageInfo() { + final FileContents fileContents = +- new FileContents( +- new FileText(new File("package-info.java"), Collections.singletonList(" // "))); ++ new FileContents(new FileText(new File("package-info.java"), ImmutableList.of(" // "))); + + assertWithMessage("Should return true when in package info") + .that(fileContents.inPackageInfo()) +@@ -276,10 +270,10 @@ public class FileContentsTest { + */ + @Deprecated(since = "10.2") + @Test +- public void testNotInPackageInfo() { ++ void notInPackageInfo() { + final FileContents fileContents = + new FileContents( +- new FileText(new File("some-package-info.java"), Collections.singletonList(" // "))); ++ new FileText(new File("some-package-info.java"), ImmutableList.of(" // "))); + + assertWithMessage("Should return false when not in package info") + .that(fileContents.inPackageInfo()) +@@ -287,9 +281,9 @@ public class FileContentsTest { + } + + @Test +- public void testGetJavadocBefore() { ++ void getJavadocBefore() { + final FileContents fileContents = +- new FileContents(new FileText(new File("filename"), Collections.singletonList(" "))); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of(" "))); + final Map javadoc = new HashMap<>(); + javadoc.put(0, new Comment(new String[] {"// "}, 2, 1, 2)); + TestUtil.setInternalState(fileContents, "javadocComments", javadoc); +@@ -301,7 +295,7 @@ public class FileContentsTest { + } + + @Test +- public void testExtractBlockComment() { ++ void extractBlockComment() { + final FileContents fileContents = + new FileContents( + new FileText( +@@ -317,14 +311,14 @@ public class FileContentsTest { + } + + @Test +- public void testHasIntersectionEarlyOut() throws Exception { ++ void hasIntersectionEarlyOut() throws Exception { + final FileContents fileContents = +- new FileContents(new FileText(new File("filename"), Collections.emptyList())); ++ new FileContents(new FileText(new File("filename"), ImmutableList.of())); + final Map> clangComments = + TestUtil.getInternalState(fileContents, "clangComments"); + final TextBlock textBlock = new Comment(new String[] {""}, 1, 1, 1); +- clangComments.put(1, Collections.singletonList(textBlock)); +- clangComments.put(2, Collections.emptyList()); ++ clangComments.put(1, ImmutableList.of(textBlock)); ++ clangComments.put(2, ImmutableList.of()); + + assertWithMessage("Invalid results") + .that( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileSetCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileSetCheckTest.java +index 2aa851bc9..cc5ed21e9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileSetCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileSetCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import org.junit.jupiter.api.Test; + +-public class FileSetCheckTest extends AbstractModuleTestSupport { ++final class FileSetCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class FileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTranslation() throws Exception { ++ void translation() throws Exception { + final Configuration checkConfig = createModuleConfig(TestFileSetCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputFileSetIllegalTokens.java"), expected); +@@ -45,7 +45,7 @@ public class FileSetCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessCallsFinishBeforeCallingDestroy() throws Exception { ++ void processCallsFinishBeforeCallingDestroy() throws Exception { + final Configuration checkConfig = createModuleConfig(TestFileSetCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java +index 520a96527..607f03377 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FileTextTest.java +@@ -20,7 +20,9 @@ + package com.puppycrawl.tools.checkstyle.api; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.ISO_8859_1; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractPathTestSupport; + import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; + import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; +@@ -30,11 +32,10 @@ import java.io.IOException; + import java.nio.charset.Charset; + import java.nio.charset.StandardCharsets; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class FileTextTest extends AbstractPathTestSupport { ++final class FileTextTest extends AbstractPathTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,7 +43,7 @@ public class FileTextTest extends AbstractPathTestSupport { + } + + @Test +- public void testUnsupportedCharset() throws IOException { ++ void unsupportedCharset() throws IOException { + // just to make UT coverage 100% + final String charsetName = "STRANGE_CHARSET"; + final File file = new File("any name"); +@@ -58,7 +59,7 @@ public class FileTextTest extends AbstractPathTestSupport { + } + + @Test +- public void testFileNotFound() throws IOException { ++ void fileNotFound() throws IOException { + final String charsetName = StandardCharsets.ISO_8859_1.name(); + final File file = new File("any name"); + try { +@@ -73,7 +74,7 @@ public class FileTextTest extends AbstractPathTestSupport { + } + + @Test +- public void testSupportedCharset() throws IOException { ++ void supportedCharset() throws IOException { + final String charsetName = StandardCharsets.ISO_8859_1.name(); + final FileText fileText = + new FileText(new File(getPath("InputFileTextImportControl.xml")), charsetName); +@@ -83,7 +84,7 @@ public class FileTextTest extends AbstractPathTestSupport { + } + + @Test +- public void testLineColumnBeforeCopyConstructor() throws IOException { ++ void lineColumnBeforeCopyConstructor() throws IOException { + final String charsetName = StandardCharsets.ISO_8859_1.name(); + final FileText fileText = + new FileText(new File(getPath("InputFileTextImportControl.xml")), charsetName); +@@ -97,8 +98,8 @@ public class FileTextTest extends AbstractPathTestSupport { + } + + @Test +- public void testLineColumnAfterCopyConstructor() throws IOException { +- final Charset charset = StandardCharsets.ISO_8859_1; ++ void lineColumnAfterCopyConstructor() throws IOException { ++ final Charset charset = ISO_8859_1; + final String filepath = getPath("InputFileTextImportControl.xml"); + final FileText fileText = new FileText(new File(filepath), charset.name()); + final FileText copy = new FileText(fileText); +@@ -115,7 +116,7 @@ public class FileTextTest extends AbstractPathTestSupport { + } + + @Test +- public void testLineColumnAtTheStartOfFile() throws IOException { ++ void lineColumnAtTheStartOfFile() throws IOException { + final String charsetName = StandardCharsets.ISO_8859_1.name(); + final FileText fileText = + new FileText(new File(getPath("InputFileTextImportControl.xml")), charsetName); +@@ -126,15 +127,15 @@ public class FileTextTest extends AbstractPathTestSupport { + } + + @Test +- public void testLines() throws IOException { +- final List lines = Collections.singletonList("abc"); ++ void lines() throws IOException { ++ final List lines = ImmutableList.of("abc"); + final FileText fileText = + new FileText(new File(getPath("InputFileTextImportControl.xml")), lines); + assertWithMessage("Invalid line").that(fileText.toLinesArray()).isEqualTo(new String[] {"abc"}); + } + + @Test +- public void testFindLineBreaks() throws Exception { ++ void findLineBreaks() throws Exception { + final FileText fileText = new FileText(new File("fileName"), Arrays.asList("1", "2")); + + assertWithMessage("Invalid line breaks") +@@ -156,8 +157,8 @@ public class FileTextTest extends AbstractPathTestSupport { + * @throws Exception if there is an error. + */ + @Test +- public void testFindLineBreaksCache() throws Exception { +- final FileText fileText = new FileText(new File("fileName"), Collections.emptyList()); ++ void findLineBreaksCache() throws Exception { ++ final FileText fileText = new FileText(new File("fileName"), ImmutableList.of()); + final int[] lineBreaks = {5}; + TestUtil.setInternalState(fileText, "lineBreaks", lineBreaks); + // produces NPE if used +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java +index df6a09a5d..0aaced191 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FilterSetTest.java +@@ -20,24 +20,24 @@ + package com.puppycrawl.tools.checkstyle.api; + + import static com.google.common.truth.Truth.assertWithMessage; +-import static org.junit.jupiter.api.Assertions.assertThrows; ++import static org.assertj.core.api.Assertions.assertThatThrownBy; + + import com.puppycrawl.tools.checkstyle.filters.SeverityMatchFilter; + import java.util.Objects; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class FilterSetTest { ++final class FilterSetTest { + + @Test +- public void testGetFilters() { ++ void getFilters() { + final FilterSet filterSet = new FilterSet(); + filterSet.addFilter(new SeverityMatchFilter()); + assertWithMessage("Invalid filter set size").that(filterSet.getFilters()).hasSize(1); + } + + @Test +- public void testRemoveFilters() { ++ void removeFilters() { + final FilterSet filterSet = new FilterSet(); + final Filter filter = new SeverityMatchFilter(); + filterSet.addFilter(filter); +@@ -46,14 +46,14 @@ public class FilterSetTest { + } + + @Test +- public void testToString() { ++ void testToString() { + final FilterSet filterSet = new FilterSet(); + filterSet.addFilter(new SeverityMatchFilter()); + assertWithMessage("Invalid filter set size").that(filterSet.toString()).isNotNull(); + } + + @Test +- public void testClear() { ++ void clear() { + final FilterSet filterSet = new FilterSet(); + filterSet.addFilter(new SeverityMatchFilter()); + +@@ -65,21 +65,21 @@ public class FilterSetTest { + } + + @Test +- public void testAccept() { ++ void accept() { + final FilterSet filterSet = new FilterSet(); + filterSet.addFilter(new DummyFilter(true)); + assertWithMessage("invalid accept response").that(filterSet.accept(null)).isTrue(); + } + + @Test +- public void testNotAccept() { ++ void notAccept() { + final FilterSet filterSet = new FilterSet(); + filterSet.addFilter(new DummyFilter(false)); + assertWithMessage("invalid accept response").that(filterSet.accept(null)).isFalse(); + } + + @Test +- public void testNotAcceptEvenIfOneAccepts() { ++ void notAcceptEvenIfOneAccepts() { + final FilterSet filterSet = new FilterSet(); + filterSet.addFilter(new DummyFilter(true)); + filterSet.addFilter(new DummyFilter(false)); +@@ -92,12 +92,13 @@ public class FilterSetTest { + done for the time being + */ + @Test +- public void testUnmodifiableSet() { ++ void unmodifiableSet() { + final FilterSet filterSet = new FilterSet(); + final Filter filter = new FilterSet(); + filterSet.addFilter(filter); + final Set subFilterSet = filterSet.getFilters(); +- assertThrows(UnsupportedOperationException.class, () -> subFilterSet.add(filter)); ++ assertThatThrownBy(() -> subFilterSet.add(filter)) ++ .isInstanceOf(UnsupportedOperationException.class); + } + + /* +@@ -105,7 +106,7 @@ public class FilterSetTest { + be useful for third party integrations + */ + @Test +- public void testEmptyToString() { ++ void emptyToString() { + final FilterSet filterSet = new FilterSet(); + assertWithMessage("toString() result shouldn't be an empty string") + .that(filterSet.toString()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/FullIdentTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/FullIdentTest.java +index dc7dac141..597345002 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/FullIdentTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/FullIdentTest.java +@@ -28,7 +28,7 @@ import java.io.File; + import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.Test; + +-public class FullIdentTest extends AbstractModuleTestSupport { ++final class FullIdentTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testToString() { ++ void testToString() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(TokenTypes.LITERAL_NEW); + ast.setColumnNo(14); +@@ -58,7 +58,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCreateFullIdentBelow() { ++ void createFullIdentBelow() { + final DetailAST ast = new DetailAstImpl(); + + final FullIdent indent = FullIdent.createFullIdentBelow(ast); +@@ -66,7 +66,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetDetailAst() throws Exception { ++ void getDetailAst() throws Exception { + final FileText testFileText = + new FileText( + new File(getPath("InputFullIdentTestArrayType.java")).getAbsoluteFile(), +@@ -81,7 +81,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonValidCoordinatesWithNegative() { ++ void nonValidCoordinatesWithNegative() { + final FullIdent fullIdent = prepareFullIdentWithCoordinates(14, 15); + assertWithMessage("Invalid full indent") + .that(fullIdent.toString()) +@@ -89,7 +89,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonValidCoordinatesWithZero() { ++ void nonValidCoordinatesWithZero() { + final FullIdent fullIdent = prepareFullIdentWithCoordinates(0, 0); + assertWithMessage("Invalid full indent") + .that(fullIdent.toString()) +@@ -97,7 +97,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithArrayCreateFullIdentWithArrayDeclare() throws Exception { ++ void withArrayCreateFullIdentWithArrayDeclare() throws Exception { + final FileText testFileText = + new FileText( + new File(getPath("InputFullIdentTestArrayType.java")).getAbsoluteFile(), +@@ -116,7 +116,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFullIdentAnnotation() throws Exception { ++ void fullIdentAnnotation() throws Exception { + final FileText testFileText = + new FileText( + new File(getPath("InputFullIdentAnnotation.java")).getAbsoluteFile(), +@@ -144,7 +144,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFullIdentArrayInit() throws Exception { ++ void fullIdentArrayInit() throws Exception { + final FileText testFileText = + new FileText( + new File(getPath("InputFullIdentArrayInit.java")).getAbsoluteFile(), +@@ -201,7 +201,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReturnNoAnnotation() throws Exception { ++ void returnNoAnnotation() throws Exception { + final FileText testFileText = + new FileText( + new File(getPath("InputFullIdentReturnNoAnnotation.java")).getAbsoluteFile(), +@@ -214,7 +214,7 @@ public class FullIdentTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFullyQualifiedStringArray() throws Exception { ++ void fullyQualifiedStringArray() throws Exception { + final FileText testFileText = + new FileText( + new File(getPath("InputFullIdentFullyQualifiedStringArray.java")).getAbsoluteFile(), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypesTest.java +index 6ec3c45b9..fc00cbe7e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/JavadocTokenTypesTest.java +@@ -25,17 +25,17 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsCla + import java.lang.reflect.Field; + import org.junit.jupiter.api.Test; + +-public class JavadocTokenTypesTest { ++final class JavadocTokenTypesTest { + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(JavadocTokenTypes.class)) + .isTrue(); + } + + @Test +- public void testTokenValues() { ++ void tokenValues() { + final String msg = + "Please ensure that token values in `JavadocTokenTypes.java` have not" + " changed."; + assertWithMessage(msg).that(JavadocTokenTypes.RETURN_LITERAL).isEqualTo(11); +@@ -222,7 +222,7 @@ public class JavadocTokenTypesTest { + } + + @Test +- public void testRuleOffsetValue() throws Exception { ++ void ruleOffsetValue() throws Exception { + final Field ruleTypesOffset = JavadocTokenTypes.class.getDeclaredField("RULE_TYPES_OFFSET"); + ruleTypesOffset.setAccessible(true); + assertWithMessage( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/LineColumnTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/LineColumnTest.java +index 211aade2b..79f18aa45 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/LineColumnTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/LineColumnTest.java +@@ -25,16 +25,16 @@ import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + +-public class LineColumnTest { ++final class LineColumnTest { + + @Test +- public void testCompareToBothEqual() { ++ void compareToBothEqual() { + final int actual = new LineColumn(0, 0).compareTo(new LineColumn(0, 0)); + assertWithMessage("Invalid LineColumn comparing result").that(actual).isEqualTo(0); + } + + @Test +- public void testCompareToFirstLarger() { ++ void compareToFirstLarger() { + final LineColumn lineColumn = new LineColumn(0, 0); + + final int line1column0 = new LineColumn(1, 0).compareTo(lineColumn); +@@ -44,7 +44,7 @@ public class LineColumnTest { + } + + @Test +- public void testCompareToFirstSmaller() { ++ void compareToFirstSmaller() { + final Comparable lineColumn = new LineColumn(0, 0); + + final int line1Column0 = lineColumn.compareTo(new LineColumn(1, 0)); +@@ -54,14 +54,14 @@ public class LineColumnTest { + } + + @Test +- public void testEqualsAndHashCode() { ++ void equalsAndHashCode() { + final EqualsVerifierReport ev = + EqualsVerifier.forClass(LineColumn.class).usingGetClass().report(); + assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); + } + + @Test +- public void testGetters() { ++ void getters() { + final LineColumn lineColumn = new LineColumn(2, 3); + + assertWithMessage("Invalid LineColumn comparison result") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java +index 1f5dbfc9b..6eaf6723a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/ScopeTest.java +@@ -25,20 +25,20 @@ import org.junit.jupiter.api.Test; + import org.junitpioneer.jupiter.DefaultLocale; + + /** Test cases for {@link Scope} enumeration. */ +-public class ScopeTest { ++final class ScopeTest { + + /* Additional test for jacoco, since valueOf() + * is generated by javac and jacoco reports that + * valueOf() is uncovered. + */ + @Test +- public void testScopeValueOf() { ++ void scopeValueOf() { + final Scope scope = Scope.valueOf("PRIVATE"); + assertWithMessage("Invalid scope").that(scope).isEqualTo(Scope.PRIVATE); + } + + @Test +- public void testMisc() { ++ void misc() { + final Scope scope = Scope.getInstance("public"); + assertWithMessage("Scope must not be null").that(scope).isNotNull(); + assertWithMessage("Invalid scope toString").that(scope.toString()).isEqualTo("public"); +@@ -55,7 +55,7 @@ public class ScopeTest { + } + + @Test +- public void testMixedCaseSpaces() { ++ void mixedCaseSpaces() { + assertWithMessage("Invalid scope").that(Scope.getInstance("NothinG ")).isEqualTo(Scope.NOTHING); + assertWithMessage("Invalid scope").that(Scope.getInstance(" PuBlic")).isEqualTo(Scope.PUBLIC); + assertWithMessage("Invalid scope") +@@ -74,7 +74,7 @@ public class ScopeTest { + + @DefaultLocale(language = "tr", country = "TR") + @Test +- public void testMixedCaseSpacesWithDifferentLocale() { ++ void mixedCaseSpacesWithDifferentLocale() { + assertWithMessage("Invalid scope").that(Scope.getInstance("NothinG ")).isEqualTo(Scope.NOTHING); + assertWithMessage("Invalid scope").that(Scope.getInstance(" PuBlic")).isEqualTo(Scope.PUBLIC); + assertWithMessage("Invalid scope") +@@ -92,7 +92,7 @@ public class ScopeTest { + } + + @Test +- public void testIsInAnonInner() { ++ void isInAnonInner() { + assertWithMessage("Invalid subscope").that(Scope.NOTHING.isIn(Scope.ANONINNER)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PUBLIC.isIn(Scope.ANONINNER)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.ANONINNER)).isTrue(); +@@ -102,7 +102,7 @@ public class ScopeTest { + } + + @Test +- public void testIsInPrivate() { ++ void isInPrivate() { + assertWithMessage("Invalid subscope").that(Scope.NOTHING.isIn(Scope.PRIVATE)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PUBLIC.isIn(Scope.PRIVATE)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PRIVATE)).isTrue(); +@@ -112,7 +112,7 @@ public class ScopeTest { + } + + @Test +- public void testIsInPackage() { ++ void isInPackage() { + assertWithMessage("Invalid subscope").that(Scope.NOTHING.isIn(Scope.PACKAGE)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PUBLIC.isIn(Scope.PACKAGE)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PACKAGE)).isTrue(); +@@ -122,7 +122,7 @@ public class ScopeTest { + } + + @Test +- public void testIsInProtected() { ++ void isInProtected() { + assertWithMessage("Invalid subscope").that(Scope.NOTHING.isIn(Scope.PROTECTED)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PUBLIC.isIn(Scope.PROTECTED)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PROTECTED)).isTrue(); +@@ -132,7 +132,7 @@ public class ScopeTest { + } + + @Test +- public void testIsInPublic() { ++ void isInPublic() { + assertWithMessage("Invalid subscope").that(Scope.NOTHING.isIn(Scope.PUBLIC)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PUBLIC.isIn(Scope.PUBLIC)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.PUBLIC)).isFalse(); +@@ -142,7 +142,7 @@ public class ScopeTest { + } + + @Test +- public void testIsInNothing() { ++ void isInNothing() { + assertWithMessage("Invalid subscope").that(Scope.NOTHING.isIn(Scope.NOTHING)).isTrue(); + assertWithMessage("Invalid subscope").that(Scope.PUBLIC.isIn(Scope.NOTHING)).isFalse(); + assertWithMessage("Invalid subscope").that(Scope.PROTECTED.isIn(Scope.NOTHING)).isFalse(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounterTest.java +index 111e28c69..a795c94f4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelCounterTest.java +@@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; + + import org.junit.jupiter.api.Test; + +-public class SeverityLevelCounterTest { ++final class SeverityLevelCounterTest { + + @Test +- public void testCtorException() { ++ void ctorException() { + try { + final Object test = new SeverityLevelCounter(null); + assertWithMessage("exception expected but got %s", test).fail(); +@@ -39,7 +39,7 @@ public class SeverityLevelCounterTest { + } + + @Test +- public void testAddError() { ++ void addError() { + final SeverityLevelCounter counter = new SeverityLevelCounter(SeverityLevel.ERROR); + assertWithMessage("Invalid severity level count").that(counter.getCount()).isEqualTo(0); + // not counted +@@ -59,7 +59,7 @@ public class SeverityLevelCounterTest { + } + + @Test +- public void testAddException() { ++ void addException() { + final SeverityLevelCounter counter = new SeverityLevelCounter(SeverityLevel.ERROR); + final AuditEvent event = new AuditEvent(this, "ATest.java", null); + assertWithMessage("Invalid severity level count").that(counter.getCount()).isEqualTo(0); +@@ -68,7 +68,7 @@ public class SeverityLevelCounterTest { + } + + @Test +- public void testAddExceptionWarning() { ++ void addExceptionWarning() { + final SeverityLevelCounter counter = new SeverityLevelCounter(SeverityLevel.WARNING); + final AuditEvent event = new AuditEvent(this, "ATest.java", null); + assertWithMessage("Invalid severity level count").that(counter.getCount()).isEqualTo(0); +@@ -77,7 +77,7 @@ public class SeverityLevelCounterTest { + } + + @Test +- public void testAuditStartedClearsState() { ++ void auditStartedClearsState() { + final SeverityLevelCounter counter = new SeverityLevelCounter(SeverityLevel.ERROR); + final AuditEvent event = new AuditEvent(this, "ATest.java", null); + final AuditEvent secondEvent = new AuditEvent(this, "BTest.java", null); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java +index a4bf9f433..cbfe6a448 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/SeverityLevelTest.java +@@ -25,20 +25,20 @@ import org.junit.jupiter.api.Test; + import org.junitpioneer.jupiter.DefaultLocale; + + /** Test cases for {@link SeverityLevel} enumeration. */ +-public class SeverityLevelTest { ++final class SeverityLevelTest { + + /* Additional test for jacoco, since valueOf() + * is generated by javac and jacoco reports that + * valueOf() is uncovered. + */ + @Test +- public void testSeverityLevelValueOf() { ++ void severityLevelValueOf() { + final SeverityLevel level = SeverityLevel.valueOf("INFO"); + assertWithMessage("Invalid severity level").that(level).isEqualTo(SeverityLevel.INFO); + } + + @Test +- public void testMisc() { ++ void misc() { + final SeverityLevel severityLevel = SeverityLevel.getInstance("info"); + assertWithMessage("Invalid getInstance result, should not be null") + .that(severityLevel) +@@ -60,7 +60,7 @@ public class SeverityLevelTest { + } + + @Test +- public void testMixedCaseSpaces() { ++ void mixedCaseSpaces() { + assertWithMessage("Invalid getInstance result") + .that(SeverityLevel.getInstance("IgnoRe ")) + .isEqualTo(SeverityLevel.IGNORE); +@@ -77,7 +77,7 @@ public class SeverityLevelTest { + + @DefaultLocale(language = "tr", country = "TR") + @Test +- public void testMixedCaseSpacesWithDifferentLocales() { ++ void mixedCaseSpacesWithDifferentLocales() { + assertWithMessage("Invalid getInstance result") + .that(SeverityLevel.getInstance("IgnoRe ")) + .isEqualTo(SeverityLevel.IGNORE); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java +index 9eda598e0..c06beee24 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/TokenTypesTest.java +@@ -19,22 +19,22 @@ + + package com.puppycrawl.tools.checkstyle.api; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import java.util.Arrays; +-import java.util.Collections; + import java.util.Locale; + import java.util.ResourceBundle; + import java.util.Set; +-import java.util.stream.Collectors; + import org.junit.jupiter.api.Test; + +-public class TokenTypesTest { ++final class TokenTypesTest { + + @Test +- public void testAllTokenTypesHasDescription() { ++ void allTokenTypesHasDescription() { + final String tokenTypes = "com.puppycrawl.tools.checkstyle.api.tokentypes"; + final ResourceBundle bundle = ResourceBundle.getBundle(tokenTypes, Locale.ROOT); + +@@ -42,27 +42,27 @@ public class TokenTypesTest { + Arrays.stream(TokenUtil.getAllTokenIds()) + .mapToObj(TokenUtil::getTokenName) + .filter(name -> name.charAt(0) != '$') +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + final Set actual = bundle.keySet(); + assertWithMessage("TokenTypes without description").that(actual).isEqualTo(expected); + } + + @Test +- public void testAllDescriptionsEndsWithPeriod() { ++ void allDescriptionsEndsWithPeriod() { + final Set badDescriptions = + Arrays.stream(TokenUtil.getAllTokenIds()) + .mapToObj(TokenUtil::getTokenName) + .filter(name -> name.charAt(0) != '$') + .map(TokenUtil::getShortDescription) + .filter(desc -> desc.charAt(desc.length() - 1) != '.') +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + assertWithMessage("Malformed TokenType descriptions") + .that(badDescriptions) +- .isEqualTo(Collections.emptySet()); ++ .isEqualTo(ImmutableSet.of()); + } + + @Test +- public void testGetShortDescription() { ++ void getShortDescription() { + assertWithMessage("short description for EQUAL") + .that(TokenUtil.getShortDescription("EQUAL")) + .isEqualTo("The == (equal) operator."); +@@ -89,7 +89,7 @@ public class TokenTypesTest { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(TokenTypes.class)) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/api/ViolationTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/api/ViolationTest.java +index 9691bf11f..d4feba4a5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/api/ViolationTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/api/ViolationTest.java +@@ -29,17 +29,17 @@ import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + import org.junitpioneer.jupiter.DefaultLocale; + +-public class ViolationTest { ++final class ViolationTest { + + @Test +- public void testEqualsAndHashCode() { ++ void equalsAndHashCode() { + final EqualsVerifierReport ev = + EqualsVerifier.forClass(Violation.class).usingGetClass().report(); + assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); + } + + @Test +- public void testGetSeverityLevel() { ++ void getSeverityLevel() { + final Violation violation = createSampleViolation(); + + assertWithMessage("Invalid severity level") +@@ -48,14 +48,14 @@ public class ViolationTest { + } + + @Test +- public void testGetModuleId() { ++ void getModuleId() { + final Violation violation = createSampleViolation(); + + assertWithMessage("Invalid module id").that(violation.getModuleId()).isEqualTo("module"); + } + + @Test +- public void testGetSourceName() { ++ void getSourceName() { + final Violation violation = createSampleViolation(); + + assertWithMessage("Invalid source name") +@@ -65,7 +65,7 @@ public class ViolationTest { + + @DefaultLocale("en") + @Test +- public void testMessageInEnglish() { ++ void messageInEnglish() { + final Violation violation = createSampleViolation(); + + assertWithMessage("Invalid violation") +@@ -75,7 +75,7 @@ public class ViolationTest { + + @DefaultLocale("fr") + @Test +- public void testGetKey() { ++ void getKey() { + final Violation violation = createSampleViolation(); + + assertWithMessage("Invalid violation key") +@@ -84,7 +84,7 @@ public class ViolationTest { + } + + @Test +- public void testTokenType() { ++ void tokenType() { + final Violation violation1 = + new Violation( + 1, +@@ -119,7 +119,7 @@ public class ViolationTest { + } + + @Test +- public void testGetColumnCharIndex() { ++ void getColumnCharIndex() { + final Violation violation1 = + new Violation( + 1, +@@ -140,7 +140,7 @@ public class ViolationTest { + } + + @Test +- public void testCompareToWithDifferentModuleId() { ++ void compareToWithDifferentModuleId() { + final Violation message1 = createSampleViolationWithId("module1"); + final Violation message2 = createSampleViolationWithId("module2"); + final Violation messageNull = createSampleViolationWithId(null); +@@ -155,7 +155,7 @@ public class ViolationTest { + } + + @Test +- public void testCompareToWithDifferentClass() { ++ void compareToWithDifferentClass() { + final Violation message1 = createSampleViolationWithClass(AnnotationLocationCheck.class); + final Violation message2 = createSampleViolationWithClass(AnnotationOnSameLineCheck.class); + final Violation messageNull = createSampleViolationWithClass(null); +@@ -170,7 +170,7 @@ public class ViolationTest { + } + + @Test +- public void testCompareToWithDifferentLines() { ++ void compareToWithDifferentLines() { + final Violation message1 = createSampleViolationWithLine(1); + final Violation message1a = createSampleViolationWithLine(1); + final Violation message2 = createSampleViolationWithLine(2); +@@ -182,7 +182,7 @@ public class ViolationTest { + } + + @Test +- public void testCompareToWithDifferentColumns() { ++ void compareToWithDifferentColumns() { + final Violation message1 = createSampleViolationWithColumn(1); + final Violation message1a = createSampleViolationWithColumn(1); + final Violation message2 = createSampleViolationWithColumn(2); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/bdd/ModuleInputConfiguration.java b/src/test/java/com/puppycrawl/tools/checkstyle/bdd/ModuleInputConfiguration.java +index 00cbb2393..8f1a92082 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/bdd/ModuleInputConfiguration.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/bdd/ModuleInputConfiguration.java +@@ -19,8 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.bdd; + ++import static java.util.Collections.unmodifiableMap; ++ + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +-import java.util.Collections; + import java.util.HashMap; + import java.util.Map; + +@@ -57,19 +58,19 @@ public final class ModuleInputConfiguration { + final Map properties = new HashMap<>(); + properties.putAll(defaultProperties); + properties.putAll(nonDefaultProperties); +- return Collections.unmodifiableMap(properties); ++ return unmodifiableMap(properties); + } + + public Map getDefaultProperties() { +- return Collections.unmodifiableMap(defaultProperties); ++ return unmodifiableMap(defaultProperties); + } + + public Map getNonDefaultProperties() { +- return Collections.unmodifiableMap(nonDefaultProperties); ++ return unmodifiableMap(nonDefaultProperties); + } + + public Map getModuleMessages() { +- return Collections.unmodifiableMap(moduleMessages); ++ return unmodifiableMap(moduleMessages); + } + + public DefaultConfiguration createConfiguration() { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/bdd/TestInputConfiguration.java b/src/test/java/com/puppycrawl/tools/checkstyle/bdd/TestInputConfiguration.java +index 7696daa8d..b17fafddc 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/bdd/TestInputConfiguration.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/bdd/TestInputConfiguration.java +@@ -19,13 +19,14 @@ + + package com.puppycrawl.tools.checkstyle.bdd; + ++import static java.util.Collections.unmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.Checker; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.TreeWalker; + import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.HashSet; + import java.util.List; + import java.util.Set; +@@ -72,15 +73,15 @@ public final class TestInputConfiguration { + } + + public List getChildrenModules() { +- return Collections.unmodifiableList(childrenModules); ++ return unmodifiableList(childrenModules); + } + + public List getViolations() { +- return Collections.unmodifiableList(violations); ++ return unmodifiableList(violations); + } + + public List getFilteredViolations() { +- return Collections.unmodifiableList(filteredViolations); ++ return unmodifiableList(filteredViolations); + } + + public DefaultConfiguration createConfiguration() { +@@ -155,7 +156,7 @@ public final class TestInputConfiguration { + } + + public List getChildrenModules() { +- return Collections.unmodifiableList(childrenModules); ++ return unmodifiableList(childrenModules); + } + } + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java +index 6be7a8a61..09de358c6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/ArrayTypeStyleCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { ++final class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ArrayTypeStyleCheck checkObj = new ArrayTypeStyleCheck(); + final int[] expected = {TokenTypes.ARRAY_DECLARATOR}; + assertWithMessage("Required tokens differs from expected") +@@ -43,7 +43,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavaStyleOn() throws Exception { ++ void javaStyleOn() throws Exception { + final String[] expected = { + "13:23: " + getCheckMessage(MSG_KEY), + "14:18: " + getCheckMessage(MSG_KEY), +@@ -58,7 +58,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavaStyleOff() throws Exception { ++ void javaStyleOff() throws Exception { + final String[] expected = { + "12:16: " + getCheckMessage(MSG_KEY), + "16:39: " + getCheckMessage(MSG_KEY), +@@ -74,7 +74,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNestedGenerics() throws Exception { ++ void nestedGenerics() throws Exception { + final String[] expected = { + "22:45: " + getCheckMessage(MSG_KEY), + "23:61: " + getCheckMessage(MSG_KEY), +@@ -85,7 +85,7 @@ public class ArrayTypeStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final int[] expected = {TokenTypes.ARRAY_DECLARATOR}; + final ArrayTypeStyleCheck check = new ArrayTypeStyleCheck(); + final int[] actual = check.getAcceptableTokens(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java +index 4f84c1b67..06faec60c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/AvoidEscapedUnicodeCharactersCheckTest.java +@@ -31,7 +31,7 @@ import java.util.regex.Pattern; + import java.util.stream.IntStream; + import org.junit.jupiter.api.Test; + +-public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSupport { ++final class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSupport { + + // C0 (ASCII and derivatives) + // https://en.wiktionary.org/wiki/Appendix:Control_characters#C0_.28ASCII_and_derivatives.29 +@@ -63,7 +63,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AvoidEscapedUnicodeCharactersCheck checkObj = new AvoidEscapedUnicodeCharactersCheck(); + final int[] expected = { + TokenTypes.STRING_LITERAL, TokenTypes.CHAR_LITERAL, TokenTypes.TEXT_BLOCK_CONTENT, +@@ -74,7 +74,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "17:38: " + getCheckMessage(MSG_KEY), + "19:38: " + getCheckMessage(MSG_KEY), +@@ -130,7 +130,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAllowEscapesForControlCharacterSet() throws Exception { ++ void allowEscapesForControlCharacterSet() throws Exception { + final String[] expected = { + "17:38: " + getCheckMessage(MSG_KEY), + "19:38: " + getCheckMessage(MSG_KEY), +@@ -181,7 +181,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAllowByTailComment() throws Exception { ++ void allowByTailComment() throws Exception { + final String[] expected = { + "17:38: " + getCheckMessage(MSG_KEY), + "25:38: " + getCheckMessage(MSG_KEY), +@@ -216,7 +216,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAllowAllCharactersEscaped() throws Exception { ++ void allowAllCharactersEscaped() throws Exception { + final String[] expected = { + "17:38: " + getCheckMessage(MSG_KEY), + "19:38: " + getCheckMessage(MSG_KEY), +@@ -249,7 +249,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void allowNonPrintableEscapes() throws Exception { ++ void allowNonPrintableEscapes() throws Exception { + final String[] expected = { + "17:38: " + getCheckMessage(MSG_KEY), + "19:38: " + getCheckMessage(MSG_KEY), +@@ -288,7 +288,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAllowByTailCommentWithEmoji() throws Exception { ++ void allowByTailCommentWithEmoji() throws Exception { + final String[] expected = { + "15:24: " + getCheckMessage(MSG_KEY), + "18:24: " + getCheckMessage(MSG_KEY), +@@ -302,7 +302,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAvoidEscapedUnicodeCharactersTextBlocksAllowByComment() throws Exception { ++ void avoidEscapedUnicodeCharactersTextBlocksAllowByComment() throws Exception { + final String[] expected = { + "18:30: " + getCheckMessage(MSG_KEY), + "20:30: " + getCheckMessage(MSG_KEY), +@@ -319,7 +319,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAvoidEscapedUnicodeCharactersTextBlocks() throws Exception { ++ void avoidEscapedUnicodeCharactersTextBlocks() throws Exception { + final String[] expected = { + "17:30: " + getCheckMessage(MSG_KEY), + "18:30: " + getCheckMessage(MSG_KEY), +@@ -335,7 +335,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAvoidEscapedUnicodeCharactersEscapedS() throws Exception { ++ void avoidEscapedUnicodeCharactersEscapedS() throws Exception { + final String[] expected = { + "17:21: " + getCheckMessage(MSG_KEY), + "18:22: " + getCheckMessage(MSG_KEY), +@@ -349,7 +349,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AvoidEscapedUnicodeCharactersCheck check = new AvoidEscapedUnicodeCharactersCheck(); + final int[] actual = check.getAcceptableTokens(); + final int[] expected = { +@@ -359,7 +359,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testAllowEscapesForControlCharacterSetForAllCharacters() throws Exception { ++ void allowEscapesForControlCharacterSetForAllCharacters() throws Exception { + + final int indexOfStartLineInInputFile = 16; + final String message = getCheckMessage(MSG_KEY); +@@ -383,7 +383,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + * @throws Exception when code tested throws some exception + */ + @Test +- public void testCountMatches() throws Exception { ++ void countMatches() throws Exception { + final AvoidEscapedUnicodeCharactersCheck check = new AvoidEscapedUnicodeCharactersCheck(); + final int actual = + TestUtil.invokeMethod( +@@ -396,7 +396,7 @@ public class AvoidEscapedUnicodeCharactersCheckTest extends AbstractModuleTestSu + * convenient for the sake of maintainability. + */ + @Test +- public void testNonPrintableCharsAreSorted() { ++ void nonPrintableCharsAreSorted() { + String expression = + TestUtil.getInternalStaticState( + AvoidEscapedUnicodeCharactersCheck.class, "NON_PRINTABLE_CHARS") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java +index ee63cbd9d..0ac3d8612 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/DescendantTokenCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class DescendantTokenCheckTest extends AbstractModuleTestSupport { ++final class DescendantTokenCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,13 +36,13 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputDescendantTokenIllegalTokens.java"), expected); + } + + @Test +- public void testMaximumNumber() throws Exception { ++ void maximumNumber() throws Exception { + final String[] expected = { + "32:12: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "LITERAL_NATIVE", "LITERAL_NATIVE"), + }; +@@ -50,7 +50,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessage() throws Exception { ++ void message() throws Exception { + final String[] expected = { + "32:12: Using 'native' is not allowed.", + }; +@@ -58,7 +58,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMinimumNumber() throws Exception { ++ void minimumNumber() throws Exception { + final String[] expected = { + "24:9: " + getCheckMessage(MSG_KEY_MIN, 1, 2, "LITERAL_SWITCH", "LITERAL_DEFAULT"), + }; +@@ -66,19 +66,19 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMinimumDepth() throws Exception { ++ void minimumDepth() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputDescendantTokenIllegalTokens5.java"), expected); + } + + @Test +- public void testMaximumDepth() throws Exception { ++ void maximumDepth() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputDescendantTokenIllegalTokens6.java"), expected); + } + + @Test +- public void testEmptyStatements() throws Exception { ++ void emptyStatements() throws Exception { + + final String[] expected = { + "22:7: Empty statement.", +@@ -103,7 +103,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefault() throws Exception { ++ void missingSwitchDefault() throws Exception { + + final String[] expected = { + "32:9: switch without \"default\" clause.", +@@ -114,7 +114,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStringLiteralEquality() throws Exception { ++ void stringLiteralEquality() throws Exception { + final String[] expected = { + "22:18: Literal Strings should be compared using equals(), not '=='.", + "27:20: Literal Strings should be compared using equals(), not '=='.", +@@ -125,7 +125,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTokenDefault() throws Exception { ++ void illegalTokenDefault() throws Exception { + + final String[] expected = { + "23:9: Using 'LITERAL_SWITCH' is not allowed.", +@@ -136,7 +136,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTokenNative() throws Exception { ++ void illegalTokenNative() throws Exception { + + final String[] expected = { + "32:12: Using 'LITERAL_NATIVE' is not allowed.", +@@ -145,7 +145,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReturnFromCatch() throws Exception { ++ void returnFromCatch() throws Exception { + + final String[] expected = { + "22:11: Return from catch is not allowed.", "30:11: Return from catch is not allowed.", +@@ -155,7 +155,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReturnFromFinally() throws Exception { ++ void returnFromFinally() throws Exception { + + final String[] expected = { + "22:11: Return from finally is not allowed.", "30:11: Return from finally is not allowed.", +@@ -165,7 +165,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoSum() throws Exception { ++ void noSum() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -173,7 +173,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithSumCustomMsg() throws Exception { ++ void withSumCustomMsg() throws Exception { + + final String[] expected = { + "37:32: this cannot be null.", +@@ -186,7 +186,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithSumDefaultMsg() throws Exception { ++ void withSumDefaultMsg() throws Exception { + + final String[] expected = { + "37:32: " + getCheckMessage(MSG_KEY_SUM_MAX, 2, 1, "EQUAL"), +@@ -199,7 +199,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithSumLessThenMinDefMsg() throws Exception { ++ void withSumLessThenMinDefMsg() throws Exception { + + final String[] expected = { + "32:44: " + getCheckMessage(MSG_KEY_SUM_MIN, 0, 3, "EQUAL"), +@@ -215,7 +215,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithSumLessThenMinCustomMsg() throws Exception { ++ void withSumLessThenMinCustomMsg() throws Exception { + + final String[] expected = { + "31:44: custom message", +@@ -231,7 +231,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMaxTokenType() throws Exception { ++ void maxTokenType() throws Exception { + final String[] expected = { + "21:48: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "OBJBLOCK", "LCURLY"), + "21:48: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "OBJBLOCK", "RCURLY"), +@@ -240,7 +240,7 @@ public class DescendantTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMaxTokenTypeReverseOrder() throws Exception { ++ void maxTokenTypeReverseOrder() throws Exception { + final String[] expected = { + "21:49: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "OBJBLOCK", "LCURLY"), + "21:49: " + getCheckMessage(MSG_KEY_MAX, 1, 0, "OBJBLOCK", "RCURLY"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java +index 3ac049e18..67c52a925 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/FinalParametersCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class FinalParametersCheckTest extends AbstractModuleTestSupport { ++final class FinalParametersCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultTokens() throws Exception { ++ void defaultTokens() throws Exception { + final String[] expected = { + "27:26: " + getCheckMessage(MSG_KEY, "s"), + "42:26: " + getCheckMessage(MSG_KEY, "i"), +@@ -51,7 +51,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCtorToken() throws Exception { ++ void ctorToken() throws Exception { + final String[] expected = { + "28:27: " + getCheckMessage(MSG_KEY, "s"), + "43:27: " + getCheckMessage(MSG_KEY, "i"), +@@ -61,7 +61,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodToken() throws Exception { ++ void methodToken() throws Exception { + final String[] expected = { + "58:17: " + getCheckMessage(MSG_KEY, "s"), + "74:17: " + getCheckMessage(MSG_KEY, "s"), +@@ -76,7 +76,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCatchToken() throws Exception { ++ void catchToken() throws Exception { + final String[] expected = { + "130:16: " + getCheckMessage(MSG_KEY, "npe"), + "136:16: " + getCheckMessage(MSG_KEY, "e"), +@@ -86,7 +86,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForEachClauseToken() throws Exception { ++ void forEachClauseToken() throws Exception { + final String[] expected = { + "157:13: " + getCheckMessage(MSG_KEY, "s"), "165:13: " + getCheckMessage(MSG_KEY, "s"), + }; +@@ -94,7 +94,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnorePrimitiveTypesParameters() throws Exception { ++ void ignorePrimitiveTypesParameters() throws Exception { + final String[] expected = { + "14:22: " + getCheckMessage(MSG_KEY, "k"), + "15:15: " + getCheckMessage(MSG_KEY, "s"), +@@ -108,7 +108,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPrimitiveTypesParameters() throws Exception { ++ void primitiveTypesParameters() throws Exception { + final String[] expected = { + "13:14: " + getCheckMessage(MSG_KEY, "i"), + "14:15: " + getCheckMessage(MSG_KEY, "i"), +@@ -129,7 +129,7 @@ public class FinalParametersCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReceiverParameters() throws Exception { ++ void receiverParameters() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFinalParametersReceiver.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java +index f28a691c1..a97d9ba66 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/NewlineAtEndOfFileCheckTest.java +@@ -40,7 +40,7 @@ import java.util.List; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { ++final class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -48,13 +48,13 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewlineLfAtEndOfFile() throws Exception { ++ void newlineLfAtEndOfFile() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileLf.java"), expected); + } + + @Test +- public void testNewlineLfAtEndOfFileLfNotOverlapWithCrLf() throws Exception { ++ void newlineLfAtEndOfFileLfNotOverlapWithCrLf() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_WRONG_ENDING), + }; +@@ -62,19 +62,19 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewlineCrlfAtEndOfFile() throws Exception { ++ void newlineCrlfAtEndOfFile() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileCrlf3.java"), expected); + } + + @Test +- public void testNewlineCrAtEndOfFile() throws Exception { ++ void newlineCrAtEndOfFile() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileCr.java"), expected); + } + + @Test +- public void testAnyNewlineAtEndOfFile() throws Exception { ++ void anyNewlineAtEndOfFile() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileCrlf2.java"), expected); + verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileLf2.java"), expected); +@@ -82,7 +82,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoNewlineLfAtEndOfFile() throws Exception { ++ void noNewlineLfAtEndOfFile() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_NEWLINE_EOF), + }; +@@ -90,7 +90,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoNewlineAtEndOfFile() throws Exception { ++ void noNewlineAtEndOfFile() throws Exception { + final String msgKeyNoNewlineEof = "File does not end with a newline :)"; + final String[] expected = { + "1: " + msgKeyNoNewlineEof, +@@ -99,7 +99,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetLineSeparatorFailure() throws Exception { ++ void setLineSeparatorFailure() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); + checkConfig.addProperty("lineSeparator", "ct"); + try { +@@ -116,7 +116,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyFileFile() throws Exception { ++ void emptyFileFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); + checkConfig.addProperty("lineSeparator", LineSeparatorOption.LF.toString()); + final String[] expected = { +@@ -126,7 +126,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithEmptyLineOnly() throws Exception { ++ void fileWithEmptyLineOnly() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); + checkConfig.addProperty("lineSeparator", LineSeparatorOption.LF.toString()); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -134,7 +134,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithEmptyLineOnlyWithLfCrCrlf() throws Exception { ++ void fileWithEmptyLineOnlyWithLfCrCrlf() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); + checkConfig.addProperty("lineSeparator", LineSeparatorOption.LF_CR_CRLF.toString()); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -142,7 +142,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongFile() throws Exception { ++ void wrongFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NewlineAtEndOfFileCheck.class); + final NewlineAtEndOfFileCheck check = new NewlineAtEndOfFileCheck(); + check.configure(checkConfig); +@@ -159,7 +159,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongSeparatorLength() throws Exception { ++ void wrongSeparatorLength() throws Exception { + try (RandomAccessFile file = + new ReadZeroRandomAccessFile(getPath("InputNewlineAtEndOfFileLf.java"), "r")) { + TestUtil.invokeMethod( +@@ -175,7 +175,7 @@ public class NewlineAtEndOfFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNewlineAtEndOfFileTestTrimProperty.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckTest.java +index 209af4cd5..5bcb77237 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/NoCodeInFileCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { ++final class NoCodeInFileCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final NoCodeInFileCheck checkObj = new NoCodeInFileCheck(); + assertWithMessage("Required tokens array is not empty") + .that(checkObj.getRequiredTokens()) +@@ -43,7 +43,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final NoCodeInFileCheck checkObj = new NoCodeInFileCheck(); + assertWithMessage("Acceptable tokens array is not empty") + .that(checkObj.getAcceptableTokens()) +@@ -51,7 +51,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlank() throws Exception { ++ void blank() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NoCodeInFileCheck.class); + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_CODE), +@@ -60,7 +60,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleLineComment() throws Exception { ++ void singleLineComment() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NoCodeInFileCheck.class); + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_CODE), +@@ -69,7 +69,7 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiLineComment() throws Exception { ++ void multiLineComment() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_CODE), + }; +@@ -77,12 +77,12 @@ public class NoCodeInFileCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileContainingCode() throws Exception { ++ void fileContainingCode() throws Exception { + verifyWithInlineConfigParser(getPath("InputNoCodeInFile4.java"), CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testBothSingleLineAndMultiLineComment() throws Exception { ++ void bothSingleLineAndMultiLineComment() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY_NO_CODE), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckTest.java +index 90705283b..79dca8198 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/OrderedPropertiesCheckTest.java +@@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck.MSG_IO_EXCEPTION_KEY; + import static com.puppycrawl.tools.checkstyle.checks.OrderedPropertiesCheck.MSG_KEY; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.api.FileText; +@@ -33,11 +34,10 @@ import java.io.IOException; + import java.io.InputStream; + import java.nio.file.Files; + import java.nio.file.NoSuchFileException; +-import java.util.Collections; + import java.util.SortedSet; + import org.junit.jupiter.api.Test; + +-public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { ++final class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -46,7 +46,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + + /** Tests the ordinal work of a check. Test of sub keys, repeating key pairs in wrong order */ + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final String[] expected = { + "8: " + getCheckMessage(MSG_KEY, "key1", "key2"), +@@ -58,7 +58,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testKeysOnly() throws Exception { ++ void keysOnly() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final String[] expected = { + "3: " + getCheckMessage(MSG_KEY, "key1", "key2"), +@@ -67,7 +67,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyKeys() throws Exception { ++ void emptyKeys() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final String[] expected = { + "3: " + getCheckMessage(MSG_KEY, "key11", "key2"), +@@ -76,7 +76,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMalformedValue() throws Exception { ++ void malformedValue() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final String fileName = getPath("InputOrderedProperties3MalformedValue.properties"); + +@@ -87,7 +87,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentsMultiLine() throws Exception { ++ void commentsMultiLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final String[] expected = { + "5: " + getCheckMessage(MSG_KEY, "aKey", "multi.line"), +@@ -96,7 +96,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineNumberRepeatingPreviousKey() throws Exception { ++ void lineNumberRepeatingPreviousKey() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final String[] expected = { + "3: " + getCheckMessage(MSG_KEY, "a", "b"), +@@ -106,7 +106,7 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShouldNotProcessFilesWithWrongFileExtension() throws Exception { ++ void shouldNotProcessFilesWithWrongFileExtension() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputOrderedProperties.txt"), expected); +@@ -114,13 +114,13 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + + /** Tests IO exception, that can occur during reading of properties file. */ + @Test +- public void testIoException() throws Exception { ++ void ioException() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final OrderedPropertiesCheck check = new OrderedPropertiesCheck(); + check.configure(checkConfig); + final String fileName = getPath("InputOrderedPropertiesCheckNotExisting.properties"); + final File file = new File(fileName); +- final FileText fileText = new FileText(file, Collections.emptyList()); ++ final FileText fileText = new FileText(file, ImmutableList.of()); + final SortedSet violations = check.process(file, fileText); + assertWithMessage("Wrong violations count").that(violations).hasSize(1); + final Violation violation = violations.iterator().next(); +@@ -140,21 +140,21 @@ public class OrderedPropertiesCheckTest extends AbstractModuleTestSupport { + * returning zero size. This will keep the for loop intact. + */ + @Test +- public void testKeepForLoopIntact() throws Exception { ++ void keepForLoopIntact() throws Exception { + + final DefaultConfiguration checkConfig = createModuleConfig(OrderedPropertiesCheck.class); + final OrderedPropertiesCheck check = new OrderedPropertiesCheck(); + check.configure(checkConfig); + final String fileName = getPath("InputOrderedProperties2EmptyValue.properties"); + final File file = new File(fileName); +- final FileText fileText = new FileText(file, Collections.emptyList()); ++ final FileText fileText = new FileText(file, ImmutableList.of()); + final SortedSet violations = check.process(file, fileText); + + assertWithMessage("Wrong violations count").that(violations).hasSize(1); + } + + @Test +- public void testFileExtension() { ++ void fileExtension() { + + final OrderedPropertiesCheck check = new OrderedPropertiesCheck(); + assertWithMessage("File extension should be set") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java +index 76e7e81dc..85764c7d3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/OuterTypeFilenameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { ++final class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final OuterTypeFilenameCheck checkObj = new OuterTypeFilenameCheck(); + final int[] expected = { + TokenTypes.CLASS_DEF, +@@ -50,19 +50,19 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGood1() throws Exception { ++ void good1() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeFilenameIllegalTokens.java"), expected); + } + + @Test +- public void testGood2() throws Exception { ++ void good2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeFilename15Extensions.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final OuterTypeFilenameCheck check = new OuterTypeFilenameCheck(); + final int[] actual = check.getAcceptableTokens(); + final int[] expected = { +@@ -78,13 +78,13 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNestedClass() throws Exception { ++ void nestedClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeFilename1.java"), expected); + } + + @Test +- public void testNestedClass2() throws Exception { ++ void nestedClass2() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), + }; +@@ -92,19 +92,19 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinePublic() throws Exception { ++ void finePublic() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeFilename2.java"), expected); + } + + @Test +- public void testPublicClassIsNotFirst() throws Exception { ++ void publicClassIsNotFirst() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeFilenameCheckPublic.java"), expected); + } + + @Test +- public void testNoPublicClasses() throws Exception { ++ void noPublicClasses() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), + }; +@@ -112,13 +112,13 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFineDefault() throws Exception { ++ void fineDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeFilename3.java"), expected); + } + + @Test +- public void testWrongDefault() throws Exception { ++ void wrongDefault() throws Exception { + final String[] expected = { + "10:2: " + getCheckMessage(MSG_KEY), + }; +@@ -126,7 +126,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageAnnotation() throws Exception { ++ void packageAnnotation() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -134,7 +134,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOuterTypeFilenameRecords() throws Exception { ++ void outerTypeFilenameRecords() throws Exception { + + final String[] expected = { + "10:1: " + getCheckMessage(MSG_KEY), +@@ -144,7 +144,7 @@ public class OuterTypeFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOuterTypeFilenameRecordsMethodRecordDef() throws Exception { ++ void outerTypeFilenameRecordsMethodRecordDef() throws Exception { + + final String[] expected = { + "10:1: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java +index 56e63e8b7..43812e80f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/SuppressWarningsHolderTest.java +@@ -46,7 +46,7 @@ import java.util.Optional; + import org.junit.jupiter.api.AfterEach; + import org.junit.jupiter.api.Test; + +-public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { ++final class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -54,7 +54,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @AfterEach +- public void cleanUp() { ++ void cleanUp() { + // clear cache that may have been set by tests + + new SuppressWarningsHolder().beginTree(null); +@@ -65,7 +65,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGet() { ++ void get() { + final SuppressWarningsHolder checkObj = new SuppressWarningsHolder(); + final int[] expected = {TokenTypes.ANNOTATION}; + assertWithMessage("Required token array differs from expected") +@@ -77,14 +77,14 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOnComplexAnnotations() throws Exception { ++ void onComplexAnnotations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder.java"), expected); + } + + @Test +- public void testOnComplexAnnotationsNonConstant() throws Exception { ++ void onComplexAnnotationsNonConstant() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -92,14 +92,14 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomAnnotation() throws Exception { ++ void customAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder5.java"), expected); + } + + @Test +- public void testAll() throws Exception { ++ void all() throws Exception { + final String[] expected = { + "21:23: " + + getCheckMessage( +@@ -110,7 +110,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetDefaultAlias() { ++ void getDefaultAlias() { + assertWithMessage("Default alias differs from expected") + .that(SuppressWarningsHolder.getDefaultAlias("SomeName")) + .isEqualTo("somename"); +@@ -120,7 +120,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetAliasListEmpty() { ++ void setAliasListEmpty() { + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + holder.setAliasList(""); + assertWithMessage("Empty alias list should not be set") +@@ -129,7 +129,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetAliasListCorrect() { ++ void setAliasListCorrect() { + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + holder.setAliasList("alias=value"); + assertWithMessage("Alias differs from expected") +@@ -138,7 +138,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetAliasListWrong() { ++ void setAliasListWrong() { + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + + try { +@@ -152,7 +152,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressed() throws Exception { ++ void isSuppressed() throws Exception { + populateHolder("MockEntry", 100, 100, 350, 350); + final AuditEvent event = createAuditEvent("check", 100, 10); + +@@ -162,7 +162,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressedByName() throws Exception { ++ void isSuppressedByName() throws Exception { + populateHolder("check", 100, 100, 350, 350); + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + final AuditEvent event = createAuditEvent("id", 110, 10); +@@ -174,7 +174,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressedByModuleId() throws Exception { ++ void isSuppressedByModuleId() throws Exception { + populateHolder("check", 100, 100, 350, 350); + final AuditEvent event = createAuditEvent("check", 350, 350); + +@@ -184,7 +184,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressedAfterEventEnd() throws Exception { ++ void isSuppressedAfterEventEnd() throws Exception { + populateHolder("check", 100, 100, 350, 350); + final AuditEvent event = createAuditEvent("check", 350, 352); + +@@ -194,7 +194,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressedAfterEventEnd2() throws Exception { ++ void isSuppressedAfterEventEnd2() throws Exception { + populateHolder("check", 100, 100, 350, 350); + final AuditEvent event = createAuditEvent("check", 400, 10); + +@@ -204,7 +204,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressedAfterEventStart() throws Exception { ++ void isSuppressedAfterEventStart() throws Exception { + populateHolder("check", 100, 100, 350, 350); + final AuditEvent event = createAuditEvent("check", 100, 100); + +@@ -214,7 +214,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressedAfterEventStart2() throws Exception { ++ void isSuppressedAfterEventStart2() throws Exception { + populateHolder("check", 100, 100, 350, 350); + final AuditEvent event = createAuditEvent("check", 100, 0); + +@@ -224,7 +224,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsSuppressedWithAllArgument() throws Exception { ++ void isSuppressedWithAllArgument() throws Exception { + populateHolder("all", 100, 100, 350, 350); + + final Checker source = new Checker(); +@@ -252,21 +252,21 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationInTry() throws Exception { ++ void annotationInTry() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder2.java"), expected); + } + + @Test +- public void testEmptyAnnotation() throws Exception { ++ void emptyAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder3.java"), expected); + } + + @Test +- public void testGetAllAnnotationValuesWrongArg() throws ReflectiveOperationException { ++ void getAllAnnotationValuesWrongArg() throws ReflectiveOperationException { + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + final Method getAllAnnotationValues = + holder.getClass().getDeclaredMethod("getAllAnnotationValues", DetailAST.class); +@@ -302,7 +302,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAnnotationValuesWrongArg() throws ReflectiveOperationException { ++ void getAnnotationValuesWrongArg() throws ReflectiveOperationException { + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + final Method getAllAnnotationValues = + holder.getClass().getDeclaredMethod("getAnnotationValues", DetailAST.class); +@@ -332,7 +332,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAnnotationTargetWrongArg() throws ReflectiveOperationException { ++ void getAnnotationTargetWrongArg() throws ReflectiveOperationException { + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + final Method getAnnotationTarget = + holder.getClass().getDeclaredMethod("getAnnotationTarget", DetailAST.class); +@@ -366,7 +366,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAstWithoutChildren() { ++ void astWithoutChildren() { + final SuppressWarningsHolder holder = new SuppressWarningsHolder(); + final DetailAstImpl methodDef = new DetailAstImpl(); + methodDef.setType(TokenTypes.METHOD_DEF); +@@ -382,22 +382,22 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationWithFullName() throws Exception { ++ void annotationWithFullName() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder4.java"), expected); + } + + @Test +- public void testSuppressWarningsAsAnnotationProperty() throws Exception { ++ void suppressWarningsAsAnnotationProperty() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSuppressWarningsHolder7.java"), expected); + } + +- @Test + @SuppressWarnings("unchecked") +- public void testClearState() throws Exception { ++ @Test ++ void clearState() throws Exception { + final SuppressWarningsHolder check = new SuppressWarningsHolder(); + + final Optional annotationDef = +@@ -412,7 +412,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- annotationDef.get(), ++ annotationDef.orElseThrow(), + "ENTRIES", + entries -> ((ThreadLocal>) entries).get().isEmpty())) + .isTrue(); +@@ -443,7 +443,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressWarningsTextBlocks() throws Exception { ++ void suppressWarningsTextBlocks() throws Exception { + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + + final String[] expected = { +@@ -463,7 +463,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithAndWithoutCheckSuffixDifferentCases() throws Exception { ++ void withAndWithoutCheckSuffixDifferentCases() throws Exception { + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + final String[] expected = { + "16:30: " +@@ -477,7 +477,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAliasList() throws Exception { ++ void aliasList() throws Exception { + final String[] expected = { + "16:17: " + getCheckMessage(ParameterNumberCheck.class, ParameterNumberCheck.MSG_KEY, 7, 8), + "28:17: " + getCheckMessage(ParameterNumberCheck.class, ParameterNumberCheck.MSG_KEY, 7, 8), +@@ -486,7 +486,7 @@ public class SuppressWarningsHolderTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAliasList2() throws Exception { ++ void aliasList2() throws Exception { + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + final String[] expected = { + "16:29: " +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java +index 1bdafb670..4cf5add90 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TodoCommentCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class TodoCommentCheckTest extends AbstractModuleTestSupport { ++final class TodoCommentCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class TodoCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final TodoCommentCheck checkObj = new TodoCommentCheck(); + final int[] expected = {TokenTypes.COMMENT_CONTENT}; + assertWithMessage("Required tokens differs from expected") +@@ -43,7 +43,7 @@ public class TodoCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "1:3: " + getCheckMessage(MSG_KEY, "FIXME:"), + "164:7: " + getCheckMessage(MSG_KEY, "FIXME:"), +@@ -54,7 +54,7 @@ public class TodoCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final int[] expected = {TokenTypes.COMMENT_CONTENT}; + final TodoCommentCheck check = new TodoCommentCheck(); + final int[] actual = check.getAcceptableTokens(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java +index aa42f18fc..123505404 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TrailingCommentCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class TrailingCommentCheckTest extends AbstractModuleTestSupport { ++final class TrailingCommentCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final TrailingCommentCheck checkObj = new TrailingCommentCheck(); + final int[] expected = { + TokenTypes.SINGLE_LINE_COMMENT, TokenTypes.BLOCK_COMMENT_BEGIN, +@@ -46,7 +46,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final TrailingCommentCheck checkObj = new TrailingCommentCheck(); + final int[] expected = { + TokenTypes.SINGLE_LINE_COMMENT, TokenTypes.BLOCK_COMMENT_BEGIN, +@@ -57,7 +57,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaults() throws Exception { ++ void defaults() throws Exception { + final String[] expected = { + "13:12: " + getCheckMessage(MSG_KEY), + "17:12: " + getCheckMessage(MSG_KEY), +@@ -72,7 +72,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLegalComment() throws Exception { ++ void legalComment() throws Exception { + final String[] expected = { + "13:12: " + getCheckMessage(MSG_KEY), + "17:12: " + getCheckMessage(MSG_KEY), +@@ -86,7 +86,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFormat() throws Exception { ++ void format() throws Exception { + final String[] expected = { + "1:1: " + getCheckMessage(MSG_KEY), + "12:12: " + getCheckMessage(MSG_KEY), +@@ -111,7 +111,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLegalCommentWithNoPrecedingWhitespace() throws Exception { ++ void legalCommentWithNoPrecedingWhitespace() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -119,7 +119,7 @@ public class TrailingCommentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithEmoji() throws Exception { ++ void withEmoji() throws Exception { + final String[] expected = { + "13:24: " + getCheckMessage(MSG_KEY), + "15:27: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java +index b3912fd08..705f4e7e0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/TranslationCheckTest.java +@@ -22,7 +22,9 @@ package com.puppycrawl.tools.checkstyle.checks; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.TranslationCheck.MSG_KEY; + import static com.puppycrawl.tools.checkstyle.checks.TranslationCheck.MSG_KEY_MISSING_TRANSLATION_FILE; ++import static java.nio.charset.StandardCharsets.UTF_8; + ++import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; + import com.puppycrawl.tools.checkstyle.AbstractAutomaticBean.OutputStreamOptions; + import com.puppycrawl.tools.checkstyle.AbstractXmlTestSupport; +@@ -44,7 +46,6 @@ import java.io.Writer; + import java.lang.reflect.Field; + import java.nio.charset.StandardCharsets; + import java.nio.file.Files; +-import java.util.Collections; + import java.util.Set; + import java.util.SortedSet; + import java.util.TreeSet; +@@ -52,7 +53,7 @@ import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + import org.w3c.dom.Node; + +-public class TranslationCheckTest extends AbstractXmlTestSupport { ++final class TranslationCheckTest extends AbstractXmlTestSupport { + + @TempDir public File temporaryFolder; + +@@ -62,7 +63,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testTranslation() throws Exception { ++ void translation() throws Exception { + final Configuration checkConfig = createModuleConfig(TranslationCheck.class); + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY, "only.english"), +@@ -79,7 +80,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testDifferentBases() throws Exception { ++ void differentBases() throws Exception { + final Configuration checkConfig = createModuleConfig(TranslationCheck.class); + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY, "only.english"), +@@ -98,9 +99,9 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testDifferentPaths() throws Exception { ++ void differentPaths() throws Exception { + final File file = new File(temporaryFolder, "messages_test_de.properties"); +- try (Writer writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { ++ try (Writer writer = Files.newBufferedWriter(file.toPath(), UTF_8)) { + final String content = "hello=Hello\ncancel=Cancel"; + writer.write(content); + } +@@ -122,7 +123,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testStateIsCleared() throws Exception { ++ void stateIsCleared() throws Exception { + final File fileToProcess = new File(getPath("InputTranslationCheckFireErrors_de.properties")); + final String charset = StandardCharsets.UTF_8.name(); + final TranslationCheck check = new TranslationCheck(); +@@ -138,7 +139,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testFileExtension() throws Exception { ++ void fileExtension() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("baseName", "^InputTranslation.*$"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -149,7 +150,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testLogOutput() throws Exception { ++ void logOutput() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "ja,de"); + checkConfig.addProperty("baseName", "^InputTranslation.*$"); +@@ -176,9 +177,9 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + checker, + propertyFiles, + ImmutableMap.of( +- ":1", Collections.singletonList(" " + firstErrorMessage), ++ ":1", ImmutableList.of(" " + firstErrorMessage), + "InputTranslationCheckFireErrors_de.properties", +- Collections.singletonList(line + secondErrorMessage))); ++ ImmutableList.of(line + secondErrorMessage))); + + verifyXml( + getPath("ExpectedTranslationLog.xml"), +@@ -189,7 +190,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testOnePropertyFileSet() throws Exception { ++ void onePropertyFileSet() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + final File[] propertyFiles = { +@@ -199,7 +200,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testLogIoExceptionFileNotFound() throws Exception { ++ void logIoExceptionFileNotFound() throws Exception { + // I can't put wrong file here. Checkstyle fails before check started. + // I saw some usage of file or handling of wrong file in Checker, or somewhere + // in checks running part. So I had to do it with reflection to improve coverage. +@@ -231,7 +232,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testLogIoException() throws Exception { ++ void logIoException() throws Exception { + // I can't put wrong file here. Checkstyle fails before check started. + // I saw some usage of file or handling of wrong file in Checker, or somewhere + // in checks running part. So I had to do it with reflection to improve coverage. +@@ -262,7 +263,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testLogIllegalArgumentException() throws Exception { ++ void logIllegalArgumentException() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("baseName", "^bad.*$"); + final String[] expected = { +@@ -276,7 +277,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testDefaultTranslationFileIsMissing() throws Exception { ++ void defaultTranslationFileIsMissing() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "ja,,, de, ja"); + +@@ -292,7 +293,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testTranslationFilesAreMissing() throws Exception { ++ void translationFilesAreMissing() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "ja, de"); + +@@ -309,7 +310,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testBaseNameWithSeparatorDefaultTranslationIsMissing() throws Exception { ++ void baseNameWithSeparatorDefaultTranslationIsMissing() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "fr"); + +@@ -324,7 +325,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testBaseNameWithSeparatorTranslationsAreMissing() throws Exception { ++ void baseNameWithSeparatorTranslationsAreMissing() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "fr, tr"); + +@@ -341,7 +342,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testIsNotMessagesBundle() throws Exception { ++ void isNotMessagesBundle() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "de"); + +@@ -354,7 +355,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testTranslationFileWithLanguageCountryVariantIsMissing() throws Exception { ++ void translationFileWithLanguageCountryVariantIsMissing() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "es, de"); + +@@ -371,7 +372,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testTranslationFileWithLanguageCountryVariantArePresent() throws Exception { ++ void translationFileWithLanguageCountryVariantArePresent() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "es, fr"); + +@@ -386,7 +387,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testBaseNameOption() throws Exception { ++ void baseNameOption() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "de, es, fr, ja"); + checkConfig.addProperty("baseName", "^.*Labels$"); +@@ -408,7 +409,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testFileExtensions() throws Exception { ++ void fileExtensions() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "de, es, fr, ja"); + checkConfig.addProperty("fileExtensions", "properties,translation"); +@@ -434,7 +435,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testEqualBaseNamesButDifferentExtensions() throws Exception { ++ void equalBaseNamesButDifferentExtensions() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "de, es, fr, ja"); + checkConfig.addProperty("fileExtensions", "properties,translations"); +@@ -460,7 +461,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testEqualBaseNamesButDifferentExtensions2() throws Exception { ++ void equalBaseNamesButDifferentExtensions2() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "de, es"); + checkConfig.addProperty("fileExtensions", "properties, translations"); +@@ -483,7 +484,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testRegexpToMatchPartOfBaseName() throws Exception { ++ void regexpToMatchPartOfBaseName() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "de, es, fr, ja"); + checkConfig.addProperty("fileExtensions", "properties,translations"); +@@ -504,7 +505,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testBundlesWithSameNameButDifferentPaths() throws Exception { ++ void bundlesWithSameNameButDifferentPaths() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TranslationCheck.class); + checkConfig.addProperty("requiredTranslations", "de"); + checkConfig.addProperty("fileExtensions", "properties"); +@@ -523,7 +524,7 @@ public class TranslationCheckTest extends AbstractXmlTestSupport { + } + + @Test +- public void testWrongUserSpecifiedLanguageCodes() { ++ void wrongUserSpecifiedLanguageCodes() { + final TranslationCheck check = new TranslationCheck(); + try { + check.setRequiredTranslations("11"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java +index 617a7a285..b6f761282 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UncommentedMainCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class UncommentedMainCheckTest extends AbstractModuleTestSupport { ++final class UncommentedMainCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaults() throws Exception { ++ void defaults() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_KEY), + "26:5: " + getCheckMessage(MSG_KEY), +@@ -48,7 +48,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludedClasses() throws Exception { ++ void excludedClasses() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_KEY), + "35:5: " + getCheckMessage(MSG_KEY), +@@ -58,7 +58,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokens() { ++ void tokens() { + final UncommentedMainCheck check = new UncommentedMainCheck(); + assertWithMessage("Required tokens should not be null") + .that(check.getRequiredTokens()) +@@ -75,13 +75,13 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDeepDepth() throws Exception { ++ void deepDepth() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputUncommentedMain2.java"), expected); + } + + @Test +- public void testVisitPackage() throws Exception { ++ void visitPackage() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_KEY), + }; +@@ -89,19 +89,19 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongName() throws Exception { ++ void wrongName() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputUncommentedMain3.java"), expected); + } + + @Test +- public void testWrongArrayType() throws Exception { ++ void wrongArrayType() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputUncommentedMain4.java"), expected); + } + + @Test +- public void testIllegalStateException() { ++ void illegalStateException() { + final UncommentedMainCheck check = new UncommentedMainCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.CTOR_DEF, "ctor")); +@@ -116,7 +116,7 @@ public class UncommentedMainCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecords() throws Exception { ++ void records() throws Exception { + + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java +index 3c14a936a..52aacbff3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UniquePropertiesCheckTest.java +@@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.MSG_IO_EXCEPTION_KEY; + import static com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck.MSG_KEY; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.api.FileText; +@@ -36,14 +37,13 @@ import java.lang.reflect.Method; + import java.nio.file.Files; + import java.nio.file.NoSuchFileException; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.HashMap; + import java.util.List; + import java.util.Map; + import java.util.SortedSet; + import org.junit.jupiter.api.Test; + +-public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { ++final class UniquePropertiesCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -55,14 +55,14 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testLineSeparatorOptionValueOf() { ++ void lineSeparatorOptionValueOf() { + final LineSeparatorOption option = LineSeparatorOption.valueOf("CR"); + assertWithMessage("Invalid valueOf result").that(option).isEqualTo(LineSeparatorOption.CR); + } + + /** Tests the ordinal work of a check. */ + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(UniquePropertiesCheck.class); + final String[] expected = { + "3: " + getCheckMessage(MSG_KEY, "general.exception", 2), +@@ -82,7 +82,7 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { + * @noinspectionreason JavadocReference - reference is required to specify method under test + */ + @Test +- public void testNotFoundKey() throws Exception { ++ void notFoundKey() throws Exception { + final List testStrings = new ArrayList<>(3); + final Method getLineNumber = + UniquePropertiesCheck.class.getDeclaredMethod( +@@ -100,7 +100,7 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDuplicatedProperty() throws Exception { ++ void duplicatedProperty() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(UniquePropertiesCheck.class); + final String[] expected = { + "2: " + getCheckMessage(MSG_KEY, "key", 2), +@@ -109,7 +109,7 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShouldNotProcessFilesWithWrongFileExtension() throws Exception { ++ void shouldNotProcessFilesWithWrongFileExtension() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(UniquePropertiesCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputUniqueProperties.txt"), expected); +@@ -117,13 +117,13 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { + + /** Tests IO exception, that can occur during reading of properties file. */ + @Test +- public void testIoException() throws Exception { ++ void ioException() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(UniquePropertiesCheck.class); + final UniquePropertiesCheck check = new UniquePropertiesCheck(); + check.configure(checkConfig); + final String fileName = getPath("InputUniquePropertiesCheckNotExisting.properties"); + final File file = new File(fileName); +- final FileText fileText = new FileText(file, Collections.emptyList()); ++ final FileText fileText = new FileText(file, ImmutableList.of()); + final SortedSet violations = check.process(file, fileText); + assertWithMessage("Wrong messages count: " + violations.size()).that(violations).hasSize(1); + final Violation violation = violations.iterator().next(); +@@ -137,7 +137,7 @@ public class UniquePropertiesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongKeyTypeInProperties() throws Exception { ++ void wrongKeyTypeInProperties() throws Exception { + final Class uniquePropertiesClass = + Class.forName( + "com.puppycrawl.tools.checkstyle.checks." + "UniquePropertiesCheck$UniqueProperties"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java +index 900c388c1..decc48025 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/UpperEllCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class UpperEllCheckTest extends AbstractModuleTestSupport { ++final class UpperEllCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class UpperEllCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final UpperEllCheck checkObj = new UpperEllCheck(); + final int[] expected = {TokenTypes.NUM_LONG}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class UpperEllCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithChecker() throws Exception { ++ void withChecker() throws Exception { + final String[] expected = { + "96:40: " + getCheckMessage(MSG_KEY), + }; +@@ -51,7 +51,7 @@ public class UpperEllCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptableTokens() { ++ void acceptableTokens() { + final int[] expected = {TokenTypes.NUM_LONG}; + final UpperEllCheck check = new UpperEllCheck(); + final int[] actual = check.getAcceptableTokens(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java +index 36ed7e429..9e00cacb9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationLocationCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { ++final class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AnnotationLocationCheck checkObj = new AnnotationLocationCheck(); + assertWithMessage( + "AnnotationLocationCheck#getRequiredTokens should return empty array by default") +@@ -45,14 +45,14 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputAnnotationLocationCorrect.java"), expected); + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String[] expected = { + "15:11: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnn"), + "20:15: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation1"), +@@ -83,7 +83,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrectAllTokens() throws Exception { ++ void incorrectAllTokens() throws Exception { + final String[] expected = { + "15:11: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnn3"), + "20:15: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation_13"), +@@ -114,7 +114,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AnnotationLocationCheck constantNameCheckObj = new AnnotationLocationCheck(); + final int[] actual = constantNameCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -135,13 +135,13 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithoutAnnotations() throws Exception { ++ void withoutAnnotations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotationLocationEmpty.java"), expected); + } + + @Test +- public void testWithParameters() throws Exception { ++ void withParameters() throws Exception { + final String[] expected = { + "25:9: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnnotation_12", 8, 4), + "33:9: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "MyAnnotation_12", 8, 4), +@@ -161,7 +161,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithMultipleAnnotations() throws Exception { ++ void withMultipleAnnotations() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation11"), + "14:17: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "MyAnnotation12"), +@@ -172,14 +172,14 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllTokens() throws Exception { ++ void allTokens() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputAnnotationLocationWithoutAnnotations.java"), expected); + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final String[] expected = { + "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "AnnotationAnnotation", 2, 0), + "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "AnnotationAnnotation"), +@@ -190,7 +190,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClass() throws Exception { ++ void testClass() throws Exception { + final String[] expected = { + "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "ClassAnnotation", 2, 0), + "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "ClassAnnotation"), +@@ -203,7 +203,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnum() throws Exception { ++ void testEnum() throws Exception { + final String[] expected = { + "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "EnumAnnotation", 2, 0), + "19:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "EnumAnnotation"), +@@ -214,7 +214,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final String[] expected = { + "18:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "InterfaceAnnotation", 2, 0), + "20:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "InterfaceAnnotation"), +@@ -225,7 +225,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackage() throws Exception { ++ void testPackage() throws Exception { + final String[] expected = { + "12:3: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION, "PackageAnnotation", 2, 0), + "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "PackageAnnotation"), +@@ -234,20 +234,20 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationInForEachLoopParameterAndVariableDef() throws Exception { ++ void annotationInForEachLoopParameterAndVariableDef() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputAnnotationLocationDeprecatedAndCustom.java"), expected); + } + + @Test +- public void testAnnotationMultiple() throws Exception { ++ void annotationMultiple() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotationLocationMultiple.java"), expected); + } + + @Test +- public void testAnnotationParameterized() throws Exception { ++ void annotationParameterized() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), + "20:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), +@@ -261,7 +261,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationSingleParameterless() throws Exception { ++ void annotationSingleParameterless() throws Exception { + final String[] expected = { + "23:17: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), + "25:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "Annotation"), +@@ -276,7 +276,7 @@ public class AnnotationLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationLocationRecordsAndCompactCtors() throws Exception { ++ void annotationLocationRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), + "24:5: " + getCheckMessage(MSG_KEY_ANNOTATION_LOCATION_ALONE, "SuppressWarnings"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckTest.java +index 9a5ca1368..ee38f36b7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationOnSameLineCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { ++final class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AnnotationOnSameLineCheck check = new AnnotationOnSameLineCheck(); + assertWithMessage( + "AnnotationOnSameLineCheck#getRequiredTokens should return empty array by default") +@@ -44,7 +44,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AnnotationOnSameLineCheck constantNameCheckObj = new AnnotationOnSameLineCheck(); + final int[] actual = constantNameCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -70,7 +70,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheck() throws Exception { ++ void check() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), + "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), +@@ -81,7 +81,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckAcceptableTokens() throws Exception { ++ void checkAcceptableTokens() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation3"), + "19:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Annotation"), +@@ -92,7 +92,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheck2() throws Exception { ++ void check2() throws Exception { + final String[] expected = { + "19:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Ann"), + "24:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), +@@ -103,7 +103,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckOnDifferentTokens() throws Exception { ++ void checkOnDifferentTokens() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Ann"), + "17:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "Ann"), +@@ -127,7 +127,7 @@ public class AnnotationOnSameLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationOnSameLineRecordsAndCompactCtors() throws Exception { ++ void annotationOnSameLineRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "13:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "NonNull1"), + "17:5: " + getCheckMessage(MSG_KEY_ANNOTATION_ON_SAME_LINE, "SuppressWarnings"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckTest.java +index 4c4a682eb..82a7f0e2d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheckTest.java +@@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import de.thetaphi.forbiddenapis.SuppressForbidden; + import org.junit.jupiter.api.Test; + +-public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { ++final class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -45,7 +45,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testElementStyleOptionValueOf() { ++ void elementStyleOptionValueOf() { + final AnnotationUseStyleCheck.ElementStyleOption option = + AnnotationUseStyleCheck.ElementStyleOption.valueOf("COMPACT"); + assertWithMessage("Invalid valueOf result") +@@ -58,7 +58,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testTrailingArrayCommaOptionValueOf() { ++ void trailingArrayCommaOptionValueOf() { + final AnnotationUseStyleCheck.TrailingArrayCommaOption option = + AnnotationUseStyleCheck.TrailingArrayCommaOption.valueOf("ALWAYS"); + assertWithMessage("Invalid valueOf result") +@@ -71,7 +71,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testClosingParensOptionValueOf() { ++ void closingParensOptionValueOf() { + final AnnotationUseStyleCheck.ClosingParensOption option = + AnnotationUseStyleCheck.ClosingParensOption.valueOf("ALWAYS"); + assertWithMessage("Invalid valueOf result") +@@ -88,7 +88,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + */ + @SuppressForbidden + @Test +- public void testNonTrimmedInput() throws Exception { ++ void nonTrimmedInput() throws Exception { + final DefaultConfiguration configuration = createModuleConfig(AnnotationUseStyleCheck.class); + configuration.addProperty("elementStyle", "ignore"); + configuration.addProperty("closingParens", " ignore "); +@@ -100,7 +100,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), + "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), +@@ -123,7 +123,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + + /** Test that annotation parens are always present. */ + @Test +- public void testParensAlways() throws Exception { ++ void parensAlways() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_MISSING), + "27:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_MISSING), +@@ -139,7 +139,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + + /** Test that annotation parens are never present. */ + @Test +- public void testParensNever() throws Exception { ++ void parensNever() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_PRESENT), + "40:1: " + getCheckMessage(MSG_KEY_ANNOTATION_PARENS_PRESENT), +@@ -152,7 +152,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStyleExpanded() throws Exception { ++ void styleExpanded() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "EXPANDED"), + "21:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "EXPANDED"), +@@ -170,7 +170,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStyleCompact() throws Exception { ++ void styleCompact() throws Exception { + final String[] expected = { + "52:5: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT"), + "56:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT"), +@@ -183,7 +183,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStyleCompactNoArray() throws Exception { ++ void styleCompactNoArray() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), + "14:1: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), +@@ -200,7 +200,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommaAlwaysViolations() throws Exception { ++ void commaAlwaysViolations() throws Exception { + final String[] expected = { + "12:20: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_MISSING), + "15:30: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_MISSING), +@@ -221,7 +221,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommaAlwaysViolationsNonCompilable() throws Exception { ++ void commaAlwaysViolationsNonCompilable() throws Exception { + final String[] expected = { + "15:37: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_MISSING), + "15:65: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_MISSING), +@@ -232,7 +232,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommaAlwaysNoViolations() throws Exception { ++ void commaAlwaysNoViolations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -240,7 +240,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommaAlwaysNoViolationsNonCompilable() throws Exception { ++ void commaAlwaysNoViolationsNonCompilable() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -248,7 +248,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrailingArrayIgnore() throws Exception { ++ void trailingArrayIgnore() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), + "23:13: " + getCheckMessage(MSG_KEY_ANNOTATION_INCORRECT_STYLE, "COMPACT_NO_ARRAY"), +@@ -261,7 +261,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommaNeverViolations() throws Exception { ++ void commaNeverViolations() throws Exception { + final String[] expected = { + "16:32: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_PRESENT), + "21:42: " + getCheckMessage(MSG_KEY_ANNOTATION_TRAILING_COMMA_PRESENT), +@@ -278,7 +278,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommaNeverNoViolations() throws Exception { ++ void commaNeverNoViolations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -286,21 +286,21 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEverythingMixed() throws Exception { ++ void everythingMixed() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputAnnotationUseStyleEverythingMixed.java"), expected); + } + + @Test +- public void testAnnotationsWithoutDefaultValues() throws Exception { ++ void annotationsWithoutDefaultValues() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputAnnotationUseStyleParams.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AnnotationUseStyleCheck constantNameCheckObj = new AnnotationUseStyleCheck(); + final int[] actual = constantNameCheckObj.getAcceptableTokens(); + final int[] expected = {TokenTypes.ANNOTATION}; +@@ -308,7 +308,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetOption() { ++ void getOption() { + final AnnotationUseStyleCheck check = new AnnotationUseStyleCheck(); + try { + check.setElementStyle("SHOULD_PRODUCE_ERROR"); +@@ -323,7 +323,7 @@ public class AnnotationUseStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStyleNotInList() throws Exception { ++ void styleNotInList() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputAnnotationUseStyle.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckTest.java +index 99644e438..bc36cacfa 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingDeprecatedCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { ++final class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetDefaultJavadocTokens() { ++ void getDefaultJavadocTokens() { + final MissingDeprecatedCheck missingDeprecatedCheck = new MissingDeprecatedCheck(); + final int[] expected = { + JavadocTokenTypes.JAVADOC, +@@ -48,7 +48,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredJavadocTokens() { ++ void getRequiredJavadocTokens() { + final MissingDeprecatedCheck checkObj = new MissingDeprecatedCheck(); + final int[] expected = { + JavadocTokenTypes.JAVADOC, +@@ -60,7 +60,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + + /** Tests that members that are only deprecated via javadoc are flagged. */ + @Test +- public void testBadDeprecatedAnnotation() throws Exception { ++ void badDeprecatedAnnotation() throws Exception { + + final String[] expected = { + "14: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), +@@ -79,7 +79,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + + /** Tests that members that are only deprecated via the annotation are flagged. */ + @Test +- public void testBadDeprecatedJavadoc() throws Exception { ++ void badDeprecatedJavadoc() throws Exception { + + final String[] expected = { + "18: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), +@@ -94,7 +94,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + + /** Tests various special deprecation conditions such as duplicate or empty tags. */ + @Test +- public void testSpecialCaseDeprecated() throws Exception { ++ void specialCaseDeprecated() throws Exception { + + final String[] expected = { + "12: " + getCheckMessage(MSG_KEY_JAVADOC_DUPLICATE_TAG, "@deprecated"), +@@ -114,7 +114,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + + /** Tests that good forms of deprecation are not flagged. */ + @Test +- public void testGoodDeprecated() throws Exception { ++ void goodDeprecated() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -122,7 +122,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTwoInJavadocWithoutAnnotation() throws Exception { ++ void twoInJavadocWithoutAnnotation() throws Exception { + + final String[] expected = { + "15: " + getCheckMessage(MSG_KEY_JAVADOC_DUPLICATE_TAG, "@deprecated"), +@@ -133,7 +133,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyJavadocLine() throws Exception { ++ void emptyJavadocLine() throws Exception { + + final String[] expected = { + "18: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), +@@ -143,7 +143,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfo() throws Exception { ++ void packageInfo() throws Exception { + + final String[] expected = { + "9: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), +@@ -153,7 +153,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDepPackageInfoBelowComment() throws Exception { ++ void depPackageInfoBelowComment() throws Exception { + + final String[] expected = { + "14: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_DEPRECATED), +@@ -163,7 +163,7 @@ public class MissingDeprecatedCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfoBelowComment() throws Exception { ++ void packageInfoBelowComment() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckTest.java +index 0c8bfca1e..fb8f9f259 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/MissingOverrideCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingOverrideCheckTest extends AbstractModuleTestSupport { ++final class MissingOverrideCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag. + */ + @Test +- public void testBadOverrideFromObject() throws Exception { ++ void badOverrideFromObject() throws Exception { + + final String[] expected = { + "15:5: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), +@@ -59,7 +59,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag even in Java 5 compatibility mode. + */ + @Test +- public void testBadOverrideFromObjectJ5Compatible() throws Exception { ++ void badOverrideFromObjectJ5Compatible() throws Exception { + + final String[] expected = { + "15:5: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), +@@ -77,7 +77,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag. + */ + @Test +- public void testBadOverrideFromOther() throws Exception { ++ void badOverrideFromOther() throws Exception { + final String[] expected = { + "17:3: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), + "33:3: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), +@@ -100,7 +100,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * compatibility mode. + */ + @Test +- public void testBadOverrideFromOtherJ5Compatible() throws Exception { ++ void badOverrideFromOtherJ5Compatible() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -113,7 +113,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag. + */ + @Test +- public void testBadAnnotationOverride() throws Exception { ++ void badAnnotationOverride() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), + "23:9: " + getCheckMessage(MSG_KEY_ANNOTATION_MISSING_OVERRIDE), +@@ -129,7 +129,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * compatibility mode. + */ + @Test +- public void testBadAnnotationOverrideJ5Compatible() throws Exception { ++ void badAnnotationOverrideJ5Compatible() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputMissingOverrideBadAnnotationJava5.java"), expected); +@@ -139,7 +139,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * Tests that inheritDoc misuse is properly flagged or missing Javadocs do not cause a problem. + */ + @Test +- public void testNotOverride() throws Exception { ++ void notOverride() throws Exception { + final String[] expected = { + "15:3: " + getCheckMessage(MSG_KEY_TAG_NOT_VALID_ON, "{@inheritDoc}"), + "20:3: " + getCheckMessage(MSG_KEY_TAG_NOT_VALID_ON, "{@inheritDoc}"), +@@ -153,7 +153,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag. + */ + @Test +- public void testGoodOverrideFromObject() throws Exception { ++ void goodOverrideFromObject() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -166,7 +166,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag even in Java 5 compatibility mode. + */ + @Test +- public void testGoodOverrideFromObjectJ5Compatible() throws Exception { ++ void goodOverrideFromObjectJ5Compatible() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -179,7 +179,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag. + */ + @Test +- public void testGoodOverrideFromOther() throws Exception { ++ void goodOverrideFromOther() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -191,7 +191,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * compatibility mode. + */ + @Test +- public void testGoodOverrideFromOtherJ5Compatible() throws Exception { ++ void goodOverrideFromOtherJ5Compatible() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -204,7 +204,7 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * including the inheritDoc tag. + */ + @Test +- public void testGoodAnnotationOverride() throws Exception { ++ void goodAnnotationOverride() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputMissingOverrideGoodOverride.java"), expected); +@@ -215,14 +215,14 @@ public class MissingOverrideCheckTest extends AbstractModuleTestSupport { + * compatibility mode. + */ + @Test +- public void testGoodAnnotationOverrideJ5Compatible() throws Exception { ++ void goodAnnotationOverrideJ5Compatible() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputMissingOverrideGoodOverrideJava5.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final int[] expectedTokens = {TokenTypes.METHOD_DEF}; + final MissingOverrideCheck check = new MissingOverrideCheck(); + final int[] actual = check.getAcceptableTokens(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheckTest.java +index 807fc7089..dc039994f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/PackageAnnotationCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { ++final class PackageAnnotationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { + + /** This tests a package annotation that is in the package-info.java file. */ + @Test +- public void testGoodPackageAnnotation() throws Exception { ++ void goodPackageAnnotation() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -44,7 +44,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final PackageAnnotationCheck constantNameCheckObj = new PackageAnnotationCheck(); + final int[] actual = constantNameCheckObj.getAcceptableTokens(); + final int[] expected = {TokenTypes.PACKAGE_DEF}; +@@ -52,7 +52,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoPackageAnnotation() throws Exception { ++ void noPackageAnnotation() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -60,7 +60,7 @@ public class PackageAnnotationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBadPackageAnnotation() throws Exception { ++ void badPackageAnnotation() throws Exception { + + final String[] expected = { + "10:1: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckTest.java +index b763772bf..0fbb83f31 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/annotation/SuppressWarningsCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { ++final class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings with default regex. */ + @Test +- public void testSingleDefault() throws Exception { ++ void singleDefault() throws Exception { + + final String[] expected = { + "18:23: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), +@@ -53,7 +53,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings all warnings disabled on everything. */ + @Test +- public void testSingleAll() throws Exception { ++ void singleAll() throws Exception { + + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -91,7 +91,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked warning disabled on everything. */ + @Test +- public void testSingleNoUnchecked() throws Exception { ++ void singleNoUnchecked() throws Exception { + + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -110,7 +110,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked warning disabled on certain tokens. */ + @Test +- public void testSingleNoUncheckedTokens() throws Exception { ++ void singleNoUncheckedTokens() throws Exception { + + final String[] expected = { + "13:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -126,7 +126,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings un* warning disabled on everything. */ + @Test +- public void testSingleNoUnWildcard() throws Exception { ++ void singleNoUnWildcard() throws Exception { + + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -154,7 +154,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked, unused warning disabled on everything. */ + @Test +- public void testSingleNoUncheckedUnused() throws Exception { ++ void singleNoUncheckedUnused() throws Exception { + + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -179,7 +179,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings *, unchecked, unused warning disabled on everything. */ + @Test +- public void testSingleNoUncheckedUnusedAll() throws Exception { ++ void singleNoUncheckedUnusedAll() throws Exception { + + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -217,7 +217,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings with default regex. */ + @Test +- public void testCompactDefault() throws Exception { ++ void compactDefault() throws Exception { + + final String[] expected = { + "18:24: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), +@@ -230,7 +230,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompactDefaultNonConstant() throws Exception { ++ void compactDefaultNonConstant() throws Exception { + + final String[] expected = { + "18:24: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), +@@ -255,7 +255,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings all warnings disabled on everything. */ + @Test +- public void testCompactAll() throws Exception { ++ void compactAll() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -281,7 +281,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompactAllNonConstant() throws Exception { ++ void compactAllNonConstant() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -334,7 +334,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked warning disabled on everything. */ + @Test +- public void testCompactNoUnchecked() throws Exception { ++ void compactNoUnchecked() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -349,7 +349,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked warning disabled on certain tokens. */ + @Test +- public void testCompactNoUncheckedTokens() throws Exception { ++ void compactNoUncheckedTokens() throws Exception { + + final String[] expected = { + "13:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -359,7 +359,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompactNoUncheckedTokensNonConstant() throws Exception { ++ void compactNoUncheckedTokensNonConstant() throws Exception { + + final String[] expected = { + "13:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -373,7 +373,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings un* warning disabled on everything. */ + @Test +- public void testCompactNoUnWildcard() throws Exception { ++ void compactNoUnWildcard() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -392,7 +392,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompactNoUnWildcardNonConstant() throws Exception { ++ void compactNoUnWildcardNonConstant() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -426,7 +426,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked, unused warning disabled on everything. */ + @Test +- public void testCompactNoUncheckedUnused() throws Exception { ++ void compactNoUncheckedUnused() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -444,7 +444,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompactNoUncheckedUnusedNonConstant() throws Exception { ++ void compactNoUncheckedUnusedNonConstant() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -477,7 +477,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings *, unchecked, unused warning disabled on everything. */ + @Test +- public void testCompactNoUncheckedUnusedAll() throws Exception { ++ void compactNoUncheckedUnusedAll() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -503,7 +503,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompactNoUncheckedUnusedAllNonConstant() throws Exception { ++ void compactNoUncheckedUnusedAllNonConstant() throws Exception { + + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -556,7 +556,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings with default regex. */ + @Test +- public void testExpandedDefault() throws Exception { ++ void expandedDefault() throws Exception { + + final String[] expected = { + "18:30: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), +@@ -569,7 +569,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpandedDefaultNonConstant() throws Exception { ++ void expandedDefaultNonConstant() throws Exception { + + final String[] expected = { + "18:30: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, " "), +@@ -594,7 +594,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings all warnings disabled on everything. */ + @Test +- public void testExpandedAll() throws Exception { ++ void expandedAll() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -620,7 +620,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpandedAllNonConstant() throws Exception { ++ void expandedAllNonConstant() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -673,7 +673,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked warning disabled on everything. */ + @Test +- public void testExpandedNoUnchecked() throws Exception { ++ void expandedNoUnchecked() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -687,7 +687,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpandedNoUncheckedNonConstant() throws Exception { ++ void expandedNoUncheckedNonConstant() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -711,7 +711,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked warning disabled on certain tokens. */ + @Test +- public void testExpandedNoUncheckedTokens() throws Exception { ++ void expandedNoUncheckedTokens() throws Exception { + + final String[] expected = { + "13:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -721,7 +721,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpandedNoUncheckedTokensNonConstant() throws Exception { ++ void expandedNoUncheckedTokensNonConstant() throws Exception { + + final String[] expected = { + "13:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -735,7 +735,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings un* warning disabled on everything. */ + @Test +- public void testExpandedNoUnWildcard() throws Exception { ++ void expandedNoUnWildcard() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -754,7 +754,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpandedNoUnWildcardNonConstant() throws Exception { ++ void expandedNoUnWildcardNonConstant() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -788,7 +788,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings unchecked, unused warning disabled on everything. */ + @Test +- public void testExpandedNoUncheckedUnused() throws Exception { ++ void expandedNoUncheckedUnused() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -806,7 +806,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpandedNoUncheckedUnusedNonConstant() throws Exception { ++ void expandedNoUncheckedUnusedNonConstant() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -839,7 +839,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + + /** Tests SuppressWarnings *, unchecked, unused warning disabled on everything. */ + @Test +- public void testExpandedNoUncheckedUnusedAll() throws Exception { ++ void expandedNoUncheckedUnusedAll() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -865,7 +865,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpandedNoUncheckedUnusedAllNonConstant() throws Exception { ++ void expandedNoUncheckedUnusedAllNonConstant() throws Exception { + + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +@@ -917,7 +917,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUncheckedInConstant() throws Exception { ++ void uncheckedInConstant() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -925,7 +925,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValuePairAnnotation() throws Exception { ++ void valuePairAnnotation() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -933,7 +933,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWorkingProperlyOnComplexAnnotations() throws Exception { ++ void workingProperlyOnComplexAnnotations() throws Exception { + + final String[] expected = { + "30:34: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, ""), +@@ -945,7 +945,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWorkingProperlyOnComplexAnnotationsNonConstant() throws Exception { ++ void workingProperlyOnComplexAnnotationsNonConstant() throws Exception { + + final String[] expected = { + "30:34: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, ""), +@@ -959,7 +959,7 @@ public class SuppressWarningsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressWarningsRecords() throws Exception { ++ void suppressWarningsRecords() throws Exception { + + final String[] expected = { + "24:28: " + getCheckMessage(MSG_KEY_SUPPRESSED_WARNING_NOT_ALLOWED, "unchecked"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckTest.java +index 33d2cbc4a..dd6300f88 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/AvoidNestedBlocksCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { ++final class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AvoidNestedBlocksCheck checkObj = new AvoidNestedBlocksCheck(); + final int[] expected = {TokenTypes.SLIST}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictSettings() throws Exception { ++ void strictSettings() throws Exception { + final String[] expected = { + "25:9: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), + "47:17: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), +@@ -54,7 +54,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowSwitchInCase() throws Exception { ++ void allowSwitchInCase() throws Exception { + + final String[] expected = { + "21:9: " + getCheckMessage(MSG_KEY_BLOCK_NESTED), +@@ -65,7 +65,7 @@ public class AvoidNestedBlocksCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AvoidNestedBlocksCheck constantNameCheckObj = new AvoidNestedBlocksCheck(); + final int[] actual = constantNameCheckObj.getAcceptableTokens(); + final int[] expected = {TokenTypes.SLIST}; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheckTest.java +index af05f6988..a22dc7c95 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyBlockCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class EmptyBlockCheckTest extends AbstractModuleTestSupport { ++final class EmptyBlockCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,13 +40,13 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testBlockOptionValueOf() { ++ void blockOptionValueOf() { + final BlockOption option = BlockOption.valueOf("TEXT"); + assertWithMessage("Invalid valueOf result").that(option).isEqualTo(BlockOption.TEXT); + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "38:13: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), + "40:17: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), +@@ -61,7 +61,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testText() throws Exception { ++ void text() throws Exception { + final String[] expected = { + "38:13: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "try"), + "40:17: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "finally"), +@@ -73,7 +73,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStatement() throws Exception { ++ void statement() throws Exception { + final String[] expected = { + "38:13: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), + "40:17: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), +@@ -88,7 +88,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void allowEmptyLoops() throws Exception { ++ void allowEmptyLoops() throws Exception { + final String[] expected = { + "21:21: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), + "24:34: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT), +@@ -99,7 +99,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void allowEmptyLoopsText() throws Exception { ++ void allowEmptyLoopsText() throws Exception { + final String[] expected = { + "26:21: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "if"), + "29:34: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "if"), +@@ -110,7 +110,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -129,7 +129,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowEmptyCaseWithText() throws Exception { ++ void allowEmptyCaseWithText() throws Exception { + final String[] expected = { + "16:28: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "case"), + "22:13: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "case"), +@@ -141,7 +141,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForbidCaseWithoutStmt() throws Exception { ++ void forbidCaseWithoutStmt() throws Exception { + final String[] expected = { + "16:28: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "case"), + "22:13: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "case"), +@@ -155,7 +155,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowEmptyDefaultWithText() throws Exception { ++ void allowEmptyDefaultWithText() throws Exception { + final String[] expected = { + "15:30: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), + "21:13: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), +@@ -168,7 +168,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForbidDefaultWithoutStatement() throws Exception { ++ void forbidDefaultWithoutStatement() throws Exception { + final String[] expected = { + "15:30: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "default"), + "21:13: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "default"), +@@ -184,7 +184,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyBlockWithEmoji() throws Exception { ++ void emptyBlockWithEmoji() throws Exception { + final String[] expected = { + "15:12: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "STATIC_INIT"), + "25:27: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "if"), +@@ -199,14 +199,14 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationDefaultKeyword() throws Exception { ++ void annotationDefaultKeyword() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + final String path = getPath("InputEmptyBlockAnnotationDefaultKeyword.java"); + verifyWithInlineConfigParser(path, expected); + } + + @Test +- public void testEmptyBlockSwitchExpressions() throws Exception { ++ void emptyBlockSwitchExpressions() throws Exception { + final String[] expected = { + "17:30: " + getCheckMessage(MSG_KEY_BLOCK_NO_STATEMENT, "default"), + }; +@@ -215,7 +215,7 @@ public class EmptyBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUppercaseProperty() throws Exception { ++ void uppercaseProperty() throws Exception { + final String[] expected = { + "16:30: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), + "22:13: " + getCheckMessage(MSG_KEY_BLOCK_EMPTY, "default"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckTest.java +index 85b6e3156..05caa6043 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/EmptyCatchBlockCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { ++final class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final EmptyCatchBlockCheck checkObj = new EmptyCatchBlockCheck(); + final int[] expected = {TokenTypes.LITERAL_CATCH}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "25:31: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + "32:83: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), +@@ -52,7 +52,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithUserSetValues() throws Exception { ++ void withUserSetValues() throws Exception { + final String[] expected = { + "26:31: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + "54:78: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), +@@ -67,7 +67,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLinesAreProperlySplitSystemIndependently() throws Exception { ++ void linesAreProperlySplitSystemIndependently() throws Exception { + final String[] expected = { + "25:31: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), + "53:78: " + getCheckMessage(MSG_KEY_CATCH_BLOCK_EMPTY), +@@ -88,7 +88,7 @@ public class EmptyCatchBlockCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final EmptyCatchBlockCheck constantNameCheckObj = new EmptyCatchBlockCheck(); + final int[] actual = constantNameCheckObj.getAcceptableTokens(); + final int[] expected = {TokenTypes.LITERAL_CATCH}; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheckTest.java +index 49a5bd8d7..7e28aaab2 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/LeftCurlyCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class LeftCurlyCheckTest extends AbstractModuleTestSupport { ++final class LeftCurlyCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,13 +42,13 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testLeftCurlyOptionValueOf() { ++ void leftCurlyOptionValueOf() { + final LeftCurlyOption option = LeftCurlyOption.valueOf("NL"); + assertWithMessage("Invalid valueOf result").that(option).isEqualTo(LeftCurlyOption.NL); + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final LeftCurlyCheck checkObj = new LeftCurlyCheck(); + assertWithMessage("LeftCurlyCheck#getRequiredTokens should return empty array by default") + .that(checkObj.getRequiredTokens()) +@@ -56,7 +56,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "19:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -68,7 +68,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNl() throws Exception { ++ void nl() throws Exception { + final String[] expected = { + "36:14: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 14), + "40:14: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 14), +@@ -85,7 +85,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNlow() throws Exception { ++ void nlow() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "19:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -104,7 +104,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault2() throws Exception { ++ void default2() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "22:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -126,7 +126,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewline2() throws Exception { ++ void newline2() throws Exception { + final String[] expected = { + "19:44: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 44), + "26:20: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 20), +@@ -141,7 +141,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault3() throws Exception { ++ void default3() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "20:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -174,7 +174,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewline3() throws Exception { ++ void newline3() throws Exception { + final String[] expected = { + "31:33: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 33), + "96:19: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 19), +@@ -187,7 +187,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingBraces() throws Exception { ++ void missingBraces() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "20:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -201,7 +201,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultWithAnnotations() throws Exception { ++ void defaultWithAnnotations() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "27:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -215,7 +215,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNlWithAnnotations() throws Exception { ++ void nlWithAnnotations() throws Exception { + final String[] expected = { + "48:55: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 55), + "51:41: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 41), +@@ -226,7 +226,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNlowWithAnnotations() throws Exception { ++ void nlowWithAnnotations() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "27:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -239,7 +239,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineBreakAfter() throws Exception { ++ void lineBreakAfter() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "25:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -262,7 +262,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreEnumsOptionTrue() throws Exception { ++ void ignoreEnumsOptionTrue() throws Exception { + final String[] expectedWhileTrue = { + "21:44: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 44), + }; +@@ -271,7 +271,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreEnumsOptionFalse() throws Exception { ++ void ignoreEnumsOptionFalse() throws Exception { + final String[] expectedWhileFalse = { + "17:17: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 17), + "21:44: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 44), +@@ -281,7 +281,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultLambda() throws Exception { ++ void defaultLambda() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 1), + "24:32: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 32), +@@ -291,7 +291,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewLineOptionWithLambda() throws Exception { ++ void newLineOptionWithLambda() throws Exception { + final String[] expected = { + "18:32: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 32), + "24:32: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 32), +@@ -301,7 +301,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEolSwitch() throws Exception { ++ void eolSwitch() throws Exception { + final String[] expected = { + "22:13: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 13), + "26:13: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 13), +@@ -313,7 +313,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNlSwitch() throws Exception { ++ void nlSwitch() throws Exception { + final String[] expected = { + "24:21: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 21), + "56:14: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 14), +@@ -322,7 +322,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNlowSwitch() throws Exception { ++ void nlowSwitch() throws Exception { + final String[] expected = { + "22:13: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 13), + }; +@@ -330,7 +330,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLeftCurlySwitchExpressions() throws Exception { ++ void leftCurlySwitchExpressions() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 9), + "22:17: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 17), +@@ -348,7 +348,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLeftCurlySwitchExpressionsNewLine() throws Exception { ++ void leftCurlySwitchExpressionsNewLine() throws Exception { + + final String[] expected = { + "17:57: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 57), +@@ -361,7 +361,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final LeftCurlyCheck check = new LeftCurlyCheck(); + final int[] actual = check.getAcceptableTokens(); + final int[] expected = { +@@ -394,13 +394,13 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFirstLine() throws Exception { ++ void firstLine() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLeftCurlyTestFirstLine.java"), expected); + } + + @Test +- public void testCoverageIncrease() throws Exception { ++ void coverageIncrease() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), + "30:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -416,7 +416,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLeftCurlyRecordsAndCompactCtors() throws Exception { ++ void leftCurlyRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), + "24:9: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 9), +@@ -430,7 +430,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLeftCurlyWithEmoji() throws Exception { ++ void leftCurlyWithEmoji() throws Exception { + final String[] expected = { + "17:32: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 32), + "37:9: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 9), +@@ -448,7 +448,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLeftCurlyWithEmojiNewLine() throws Exception { ++ void leftCurlyWithEmojiNewLine() throws Exception { + final String[] expected = { + "18:32: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 32), + "20:27: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 27), +@@ -468,7 +468,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -487,7 +487,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "13:12: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 12), + "20:16: " + getCheckMessage(MSG_KEY_LINE_NEW, "{", 16), +@@ -496,7 +496,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForEnumConstantDef() throws Exception { ++ void forEnumConstantDef() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), + "19:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), +@@ -505,7 +505,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void commentBeforeLeftCurly() throws Exception { ++ void commentBeforeLeftCurly() throws Exception { + final String[] expected = { + "32:5: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 5), + }; +@@ -513,7 +513,7 @@ public class LeftCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void commentBeforeLeftCurly2() throws Exception { ++ void commentBeforeLeftCurly2() throws Exception { + final String[] expected = { + "54:9: " + getCheckMessage(MSG_KEY_LINE_PREVIOUS, "{", 9), + "66:29: " + getCheckMessage(MSG_KEY_LINE_BREAK_AFTER, "{", 29), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheckTest.java +index 6e5a85d3c..b9969135f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/NeedBracesCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NeedBracesCheckTest extends AbstractModuleTestSupport { ++final class NeedBracesCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "30:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "do"), + "42:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), +@@ -63,7 +63,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testItWithAllowsOn() throws Exception { ++ void itWithAllowsOn() throws Exception { + final String[] expected = { + "44:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), + "47:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), +@@ -88,7 +88,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleLineStatements() throws Exception { ++ void singleLineStatements() throws Exception { + final String[] expected = { + "32:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), + "38:43: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), +@@ -106,7 +106,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleLineLambda() throws Exception { ++ void singleLineLambda() throws Exception { + final String[] expected = { + "16:29: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), + "19:22: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), +@@ -117,7 +117,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDoNotAllowSingleLineLambda() throws Exception { ++ void doNotAllowSingleLineLambda() throws Exception { + final String[] expected = { + "14:28: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), + "15:29: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), +@@ -131,7 +131,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleLineCaseDefault() throws Exception { ++ void singleLineCaseDefault() throws Exception { + final String[] expected = { + "81:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), + "84:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), +@@ -143,14 +143,14 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleLineCaseDefault2() throws Exception { ++ void singleLineCaseDefault2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputNeedBracesTestSingleLineCaseDefault2.java"), expected); + } + + @Test +- public void testSingleLineCaseDefaultNoSingleLine() throws Exception { ++ void singleLineCaseDefaultNoSingleLine() throws Exception { + final String[] expected = { + "18:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), + "19:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), +@@ -164,13 +164,13 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCycles() throws Exception { ++ void cycles() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNeedBracesTestCycles.java"), expected); + } + + @Test +- public void testConditions() throws Exception { ++ void conditions() throws Exception { + final String[] expected = { + "50:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), + "53:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), +@@ -180,7 +180,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowEmptyLoopBodyTrue() throws Exception { ++ void allowEmptyLoopBodyTrue() throws Exception { + final String[] expected = { + "106:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "if"), + }; +@@ -188,7 +188,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowEmptyLoopBodyFalse() throws Exception { ++ void allowEmptyLoopBodyFalse() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), + "23:9: " + getCheckMessage(MSG_KEY_NEED_BRACES, "while"), +@@ -212,14 +212,14 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptySingleLineDefaultStmt() throws Exception { ++ void emptySingleLineDefaultStmt() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputNeedBracesEmptySingleLineDefaultStmt.java"), expected); + } + + @Test +- public void testNeedBracesSwitchExpressionNoSingleLine() throws Exception { ++ void needBracesSwitchExpressionNoSingleLine() throws Exception { + final String[] expected = { + "16:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), + "18:47: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), +@@ -243,7 +243,7 @@ public class NeedBracesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNeedBracesSwitchExpression() throws Exception { ++ void needBracesSwitchExpression() throws Exception { + final String[] expected = { + "16:13: " + getCheckMessage(MSG_KEY_NEED_BRACES, "case"), + "18:47: " + getCheckMessage(MSG_KEY_NEED_BRACES, "->"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckTest.java +index 9b857c12a..08fcadde9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/blocks/RightCurlyCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class RightCurlyCheckTest extends AbstractModuleTestSupport { ++final class RightCurlyCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,13 +41,13 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testRightCurlyOptionValueOf() { ++ void rightCurlyOptionValueOf() { + final RightCurlyOption option = RightCurlyOption.valueOf("ALONE"); + assertWithMessage("Invalid valueOf result").that(option).isEqualTo(RightCurlyOption.ALONE); + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "25:17: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 17), + "28:17: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 17), +@@ -59,7 +59,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSame() throws Exception { ++ void same() throws Exception { + final String[] expected = { + "26:17: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 17), + "29:17: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 17), +@@ -74,19 +74,19 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSameOmitOneLiners() throws Exception { ++ void sameOmitOneLiners() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRightCurlyTestSameOmitOneLiners.java"), expected); + } + + @Test +- public void testSameDoesNotComplainForNonMultilineConstructs() throws Exception { ++ void sameDoesNotComplainForNonMultilineConstructs() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRightCurlyTestSame.java"), expected); + } + + @Test +- public void testAlone() throws Exception { ++ void alone() throws Exception { + final String[] expected = { + "57:13: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 13), + "94:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), +@@ -103,7 +103,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewLine() throws Exception { ++ void newLine() throws Exception { + final String[] expected = { + "86:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), + "111:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), +@@ -126,7 +126,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShouldStartLine2() throws Exception { ++ void shouldStartLine2() throws Exception { + final String[] expected = { + "86:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), + "111:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), +@@ -144,7 +144,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForceLineBreakBefore() throws Exception { ++ void forceLineBreakBefore() throws Exception { + final String[] expected = { + "38:43: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 43), + "41:17: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 17), +@@ -156,20 +156,20 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForceLineBreakBefore2() throws Exception { ++ void forceLineBreakBefore2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRightCurlyTestForceLineBreakBefore2.java"), expected); + } + + @Test +- public void testNullPointerException() throws Exception { ++ void nullPointerException() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRightCurlyTestNullPointerException.java"), expected); + } + + @Test +- public void testWithAnnotations() throws Exception { ++ void withAnnotations() throws Exception { + final String[] expected = { + "18:77: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 77), + "21:65: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 65), +@@ -246,7 +246,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAloneOrSingleLine() throws Exception { ++ void aloneOrSingleLine() throws Exception { + final String[] expected = { + "70:26: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 26), + "84:42: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 42), +@@ -293,7 +293,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCatchWithoutFinally() throws Exception { ++ void catchWithoutFinally() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 9), + }; +@@ -301,7 +301,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleLineClass() throws Exception { ++ void singleLineClass() throws Exception { + final String[] expected = { + "29:56: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 56), + }; +@@ -309,7 +309,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -328,7 +328,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlySameAndLiteralDo() throws Exception { ++ void rightCurlySameAndLiteralDo() throws Exception { + final String[] expected = { + "70:9: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 9), + "75:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), +@@ -338,7 +338,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResourceSame() throws Exception { ++ void tryWithResourceSame() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 9), + "33:67: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 67), +@@ -349,7 +349,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResourceAlone() throws Exception { ++ void tryWithResourceAlone() throws Exception { + final String[] expected = { + "27:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), + "33:67: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 67), +@@ -364,7 +364,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResourceAloneSingle() throws Exception { ++ void tryWithResourceAloneSingle() throws Exception { + final String[] expected = { + "27:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), + "36:64: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 64), +@@ -376,7 +376,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBracePolicyAloneAndSinglelineIfBlocks() throws Exception { ++ void bracePolicyAloneAndSinglelineIfBlocks() throws Exception { + final String[] expected = { + "13:32: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 32), + "15:45: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 45), +@@ -386,26 +386,26 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyIsAloneLambda() throws Exception { ++ void rightCurlyIsAloneLambda() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRightCurlyTestIsAloneLambda.java"), expected); + } + + @Test +- public void testRightCurlyIsAloneOrSinglelineLambda() throws Exception { ++ void rightCurlyIsAloneOrSinglelineLambda() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRightCurlyTestIsAloneOrSinglelineLambda.java"), expected); + } + + @Test +- public void testRightCurlyIsSameLambda() throws Exception { ++ void rightCurlyIsSameLambda() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRightCurlyTestIsSameLambda.java"), expected); + } + + @Test +- public void testOptionAlone() throws Exception { ++ void optionAlone() throws Exception { + final String[] expected = { + "16:15: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 15), + "17:21: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 21), +@@ -433,7 +433,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOptionAloneOrSingleLine() throws Exception { ++ void optionAloneOrSingleLine() throws Exception { + final String[] expected = { + "21:26: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 26), + "30:37: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 37), +@@ -450,7 +450,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlocksEndingWithSemiOptionSame() throws Exception { ++ void blocksEndingWithSemiOptionSame() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), + "21:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), +@@ -471,7 +471,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlocksEndingWithSemiOptionAlone() throws Exception { ++ void blocksEndingWithSemiOptionAlone() throws Exception { + final String[] expected = { + "13:31: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 31), + "16:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), +@@ -499,7 +499,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlocksEndingWithSemiOptionAloneOrSingleLine() throws Exception { ++ void blocksEndingWithSemiOptionAloneOrSingleLine() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), + "21:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), +@@ -520,7 +520,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewTokensAlone() throws Exception { ++ void newTokensAlone() throws Exception { + final String[] expected = { + "13:19: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 19), + "16:20: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 20), +@@ -530,7 +530,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewTokensAloneOrSingleLine() throws Exception { ++ void newTokensAloneOrSingleLine() throws Exception { + final String[] expected = { + "16:20: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 20), + }; +@@ -539,7 +539,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewTokensSame() throws Exception { ++ void newTokensSame() throws Exception { + final String[] expected = { + "16:20: " + getCheckMessage(MSG_KEY_LINE_BREAK_BEFORE, "}", 20), + }; +@@ -547,7 +547,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyDoubleBrace() throws Exception { ++ void rightCurlyDoubleBrace() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 1), + "14:2: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 2), +@@ -556,13 +556,13 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyEmptyOnSingleLine() throws Exception { ++ void rightCurlyEmptyOnSingleLine() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRightCurlyTestEmptyOnSingleLine.java"), expected); + } + + @Test +- public void testRightCurlyEndOfFile() throws Exception { ++ void rightCurlyEndOfFile() throws Exception { + final String[] expected = { + "16:2: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 2), + "16:3: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 3), +@@ -571,7 +571,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyRecordsAndCompactCtors() throws Exception { ++ void rightCurlyRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "23:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), + "23:11: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 11), +@@ -585,7 +585,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyWithEmoji() throws Exception { ++ void rightCurlyWithEmoji() throws Exception { + final String[] expected = { + "24:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), + "28:13: " + getCheckMessage(MSG_KEY_LINE_SAME, "}", 13), +@@ -598,7 +598,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyWithEmojiAloneOrSingleLine() throws Exception { ++ void rightCurlyWithEmojiAloneOrSingleLine() throws Exception { + final String[] expected = { + "24:38: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 38), + "30:43: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 43), +@@ -611,7 +611,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUppercaseOptionProperty() throws Exception { ++ void uppercaseOptionProperty() throws Exception { + final String[] expected = { + "16:46: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 46), + "21:35: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 35), +@@ -621,7 +621,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyWithIfElseAlone() throws Exception { ++ void rightCurlyWithIfElseAlone() throws Exception { + final String[] expected = { + "19:12: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 12), + "27:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), +@@ -630,7 +630,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCase() throws Exception { ++ void switchCase() throws Exception { + final String[] expected = { + "20:24: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 24), + "27:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), +@@ -644,7 +644,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCase2() throws Exception { ++ void switchCase2() throws Exception { + final String[] expected = { + "20:24: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 24), + "27:27: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 27), +@@ -654,7 +654,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCase3() throws Exception { ++ void switchCase3() throws Exception { + final String[] expected = { + "15:22: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 22), + "17:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), +@@ -677,7 +677,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCase4() throws Exception { ++ void switchCase4() throws Exception { + final String[] expected = { + "17:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), + "19:36: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 36), +@@ -693,7 +693,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCase5() throws Exception { ++ void switchCase5() throws Exception { + final String[] expected = { + "17:9: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 9), + "19:36: " + getCheckMessage(MSG_KEY_LINE_BREAK_BEFORE, "}", 36), +@@ -710,7 +710,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchExpression() throws Exception { ++ void switchExpression() throws Exception { + final String[] expected = { + "48:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), + "56:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), +@@ -721,7 +721,7 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchExpression2() throws Exception { ++ void switchExpression2() throws Exception { + final String[] expected = { + "46:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), + "54:5: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 5), +@@ -733,14 +733,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchExpression3() throws Exception { ++ void switchExpression3() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputRightCurlyTestSwitchExpression3.java"), expected); + } + + @Test +- public void testSwitchExpression4() throws Exception { ++ void switchExpression4() throws Exception { + final String[] expected = { + "117:28: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 28), + }; +@@ -749,14 +749,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchExpression5() throws Exception { ++ void switchExpression5() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputRightCurlyTestSwitchExpression5.java"), expected); + } + + @Test +- public void testSwitchWithComment() throws Exception { ++ void switchWithComment() throws Exception { + final String[] expected = { + "16:66: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 66), + "23:61: " + getCheckMessage(MSG_KEY_LINE_ALONE, "}", 61), +@@ -770,14 +770,14 @@ public class RightCurlyCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchExpression6() throws Exception { ++ void switchExpression6() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputRightCurlyTestSwitchExpression6.java"), expected); + } + + @Test +- public void testSwitchExpression7() throws Exception { ++ void switchExpression7() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputRightCurlyTestSwitchExpression7.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckTest.java +index a8903cc55..3348f0229 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ArrayTrailingCommaCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ArrayTrailingCommaCh + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { ++final class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "23:9: " + getCheckMessage(MSG_KEY), + "43:9: " + getCheckMessage(MSG_KEY), +@@ -44,7 +44,7 @@ public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final ArrayTrailingCommaCheck check = new ArrayTrailingCommaCheck(); + assertWithMessage("Invalid acceptable tokens").that(check.getAcceptableTokens()).isNotNull(); + assertWithMessage("Invalid default tokens").that(check.getDefaultTokens()).isNotNull(); +@@ -52,7 +52,7 @@ public class ArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAlwaysDemandTrailingComma() throws Exception { ++ void alwaysDemandTrailingComma() throws Exception { + final String[] expected = { + "15:26: " + getCheckMessage(MSG_KEY), + "22:29: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckTest.java +index 2b91ddb2b..ee9997a57 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidDoubleBraceInitializationCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestSupport { ++final class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestS + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "14:53: " + getCheckMessage(MSG_KEY), + "19:40: " + getCheckMessage(MSG_KEY), +@@ -54,7 +54,7 @@ public class AvoidDoubleBraceInitializationCheckTest extends AbstractModuleTestS + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final AvoidDoubleBraceInitializationCheck check = new AvoidDoubleBraceInitializationCheck(); + final int[] expected = { + TokenTypes.OBJBLOCK, +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheckTest.java +index a6ca9d5ed..9adcf612d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidInlineConditionalsCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineCondition + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport { ++final class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "34:29: " + getCheckMessage(MSG_KEY), + "35:20: " + getCheckMessage(MSG_KEY), +@@ -43,7 +43,7 @@ public class AvoidInlineConditionalsCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final AvoidInlineConditionalsCheck check = new AvoidInlineConditionalsCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidNoArgumentSuperConstructorCallCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidNoArgumentSuperConstructorCallCheckTest.java +index d6d4f1459..094e984b0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidNoArgumentSuperConstructorCallCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/AvoidNoArgumentSuperConstructorCallCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModuleTestSupport { ++final class AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModule + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "12:9: " + getCheckMessage(MSG_CTOR), +@@ -47,7 +47,7 @@ public class AvoidNoArgumentSuperConstructorCallCheckTest extends AbstractModule + } + + @Test +- public void testTokens() { ++ void tokens() { + final AvoidNoArgumentSuperConstructorCallCheck check = + new AvoidNoArgumentSuperConstructorCallCheck(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckTest.java +index 650aa83c5..5521b80e4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/CovariantEqualsCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { ++final class CovariantEqualsCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "17:24: " + getCheckMessage(MSG_KEY), + "36:20: " + getCheckMessage(MSG_KEY), +@@ -46,7 +46,7 @@ public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCovariantEqualsRecords() throws Exception { ++ void covariantEqualsRecords() throws Exception { + final String[] expected = { + "13:24: " + getCheckMessage(MSG_KEY), "29:28: " + getCheckMessage(MSG_KEY), + }; +@@ -55,7 +55,7 @@ public class CovariantEqualsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final CovariantEqualsCheck check = new CovariantEqualsCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheckTest.java +index 28f535e1b..cbea3a3e7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DeclarationOrderCheckTest.java +@@ -32,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.api.Violation; + import java.util.SortedSet; + import org.junit.jupiter.api.Test; + +-public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { ++final class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "16:5: " + getCheckMessage(MSG_ACCESS), +@@ -69,7 +69,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOnlyConstructors() throws Exception { ++ void onlyConstructors() throws Exception { + + final String[] expected = { + "53:9: " + getCheckMessage(MSG_STATIC), +@@ -84,7 +84,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOnlyModifiers() throws Exception { ++ void onlyModifiers() throws Exception { + + final String[] expected = { + "16:5: " + getCheckMessage(MSG_ACCESS), +@@ -111,7 +111,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final DeclarationOrderCheck check = new DeclarationOrderCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -125,7 +125,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParents() { ++ void parents() { + final DetailAstImpl parent = new DetailAstImpl(); + parent.setType(TokenTypes.STATIC_INIT); + final DetailAstImpl method = new DetailAstImpl(); +@@ -149,7 +149,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImproperToken() { ++ void improperToken() { + final DetailAstImpl parent = new DetailAstImpl(); + parent.setType(TokenTypes.STATIC_INIT); + final DetailAstImpl array = new DetailAstImpl(); +@@ -165,7 +165,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForwardReference() throws Exception { ++ void forwardReference() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_ACCESS), + "21:5: " + getCheckMessage(MSG_ACCESS), +@@ -181,7 +181,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDeclarationOrderRecordsAndCompactCtors() throws Exception { ++ void declarationOrderRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "21:9: " + getCheckMessage(MSG_CONSTRUCTOR), + "24:9: " + getCheckMessage(MSG_STATIC), +@@ -194,7 +194,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDeclarationOrderInterfaceMemberScopeIsPublic() throws Exception { ++ void declarationOrderInterfaceMemberScopeIsPublic() throws Exception { + final String[] expected = { + "21:3: " + getCheckMessage(MSG_STATIC), + }; +@@ -203,7 +203,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVariableAccess() throws Exception { ++ void variableAccess() throws Exception { + final String[] expected = { + "23:5: " + getCheckMessage(MSG_ACCESS), + }; +@@ -211,7 +211,7 @@ public class DeclarationOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAvoidDuplicatesForStaticFinalFields() throws Exception { ++ void avoidDuplicatesForStaticFinalFields() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MSG_STATIC), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheckTest.java +index de95c248c..85bef71f7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/DefaultComesLastCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { ++final class DefaultComesLastCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipIfLastAndSharedWithCase() throws Exception { ++ void skipIfLastAndSharedWithCase() throws Exception { + final String[] expected = { + "23:13: " + getCheckMessage(MSG_KEY_SKIP_IF_LAST_AND_SHARED_WITH_CASE), + "31:13: " + getCheckMessage(MSG_KEY_SKIP_IF_LAST_AND_SHARED_WITH_CASE), +@@ -52,7 +52,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "31:9: " + getCheckMessage(MSG_KEY), + "38:24: " + getCheckMessage(MSG_KEY), +@@ -73,14 +73,14 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultMethodsInJava8() throws Exception { ++ void defaultMethodsInJava8() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputDefaultComesLastDefaultMethodsInInterface.java"), expected); + } + + @Test +- public void testDefaultComesLastSwitchExpressions() throws Exception { ++ void defaultComesLastSwitchExpressions() throws Exception { + final String[] expected = { + "16:13: " + getCheckMessage(MSG_KEY), + "32:13: " + getCheckMessage(MSG_KEY), +@@ -91,7 +91,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultComesLastSwitchExpressionsSkipIfLast() throws Exception { ++ void defaultComesLastSwitchExpressionsSkipIfLast() throws Exception { + + final String[] expected = { + "33:13: " + getCheckMessage(MSG_KEY), "48:13: " + getCheckMessage(MSG_KEY), +@@ -101,7 +101,7 @@ public class DefaultComesLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final DefaultComesLastCheck check = new DefaultComesLastCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckTest.java +index 9783fce27..cf7aabf84 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EmptyStatementCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck. + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class EmptyStatementCheckTest extends AbstractModuleTestSupport { ++final class EmptyStatementCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class EmptyStatementCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyStatements() throws Exception { ++ void emptyStatements() throws Exception { + final String[] expected = { + "18:7: " + getCheckMessage(MSG_KEY), + "23:7: " + getCheckMessage(MSG_KEY), +@@ -57,7 +57,7 @@ public class EmptyStatementCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final EmptyStatementCheck check = new EmptyStatementCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheckTest.java +index 1d1a37279..19553ad88 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsAvoidNullCheckTest.java +@@ -26,7 +26,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { ++final class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsWithDefault() throws Exception { ++ void equalsWithDefault() throws Exception { + + final String[] expected = { + "44:27: " + getCheckMessage(MSG_EQUALS_IGNORE_CASE_AVOID_NULL), +@@ -97,7 +97,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsWithoutEqualsIgnoreCase() throws Exception { ++ void equalsWithoutEqualsIgnoreCase() throws Exception { + + final String[] expected = { + "245:21: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -148,7 +148,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsOnTheSameLine() throws Exception { ++ void equalsOnTheSameLine() throws Exception { + + final String[] expected = { + "14:28: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -158,7 +158,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsNested() throws Exception { ++ void equalsNested() throws Exception { + + final String[] expected = { + "25:34: " + getCheckMessage(MSG_EQUALS_IGNORE_CASE_AVOID_NULL), +@@ -174,7 +174,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsSuperClass() throws Exception { ++ void equalsSuperClass() throws Exception { + + final String[] expected = { + "23:35: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -183,7 +183,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputEqualsAvoidNullEnhancedInstanceof() throws Exception { ++ void inputEqualsAvoidNullEnhancedInstanceof() throws Exception { + + final String[] expected = { + "15:45: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -198,7 +198,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMisc() throws Exception { ++ void misc() throws Exception { + + final String[] expected = { + "20:17: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -207,7 +207,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsAndCompactCtors() throws Exception { ++ void recordsAndCompactCtors() throws Exception { + + final String[] expected = { + "15:23: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -221,7 +221,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsAvoidNullTextBlocks() throws Exception { ++ void equalsAvoidNullTextBlocks() throws Exception { + + final String[] expected = { + "13:24: " + getCheckMessage(MSG_EQUALS_AVOID_NULL), +@@ -235,7 +235,7 @@ public class EqualsAvoidNullCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final EqualsAvoidNullCheck check = new EqualsAvoidNullCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckTest.java +index e22807403..d8aa208f3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/EqualsHashCodeCheckTest.java +@@ -23,17 +23,17 @@ import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.MSG_KEY_EQUALS; + import static com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck.MSG_KEY_HASHCODE; + ++import com.google.common.collect.ImmutableList; + import com.google.common.collect.ImmutableMap; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { ++final class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,7 +41,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSemantic() throws Exception { ++ void semantic() throws Exception { + final String[] expected = { + "96:13: " + getCheckMessage(MSG_KEY_HASHCODE), + }; +@@ -49,7 +49,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoEquals() throws Exception { ++ void noEquals() throws Exception { + final String[] expected = { + "10:5: " + getCheckMessage(MSG_KEY_EQUALS), + }; +@@ -57,19 +57,19 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBooleanMethods() throws Exception { ++ void booleanMethods() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputEqualsHashCode.java"), expected); + } + + @Test +- public void testMultipleInputs() throws Exception { ++ void multipleInputs() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(EqualsHashCodeCheck.class); + + final List expectedFirstInputErrors = +- Collections.singletonList("10:5: " + getCheckMessage(MSG_KEY_EQUALS)); ++ ImmutableList.of("10:5: " + getCheckMessage(MSG_KEY_EQUALS)); + final List expectedSecondInputErrors = +- Collections.singletonList("96:13: " + getCheckMessage(MSG_KEY_HASHCODE)); ++ ImmutableList.of("96:13: " + getCheckMessage(MSG_KEY_HASHCODE)); + final List expectedThirdInputErrors = Arrays.asList(CommonUtil.EMPTY_STRING_ARRAY); + + final String firstInput = getPath("InputEqualsHashCodeNoEquals.java"); +@@ -90,7 +90,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsParameter() throws Exception { ++ void equalsParameter() throws Exception { + final String[] expected = { + "16:9: " + getCheckMessage(MSG_KEY_EQUALS), + "24:9: " + getCheckMessage(MSG_KEY_HASHCODE), +@@ -106,7 +106,7 @@ public class EqualsHashCodeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final EqualsHashCodeCheck check = new EqualsHashCodeCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheckTest.java +index e9a22b762..64383bd09 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ExplicitInitializationCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializati + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { ++final class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "11:17: " + getCheckMessage(MSG_KEY, "x", 0), + "12:20: " + getCheckMessage(MSG_KEY, "bar", "null"), +@@ -62,7 +62,7 @@ public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final ExplicitInitializationCheck check = new ExplicitInitializationCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -76,7 +76,7 @@ public class ExplicitInitializationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOnlyObjectReferences() throws Exception { ++ void onlyObjectReferences() throws Exception { + final String[] expected = { + "12:20: " + getCheckMessage(MSG_KEY, "bar", "null"), + "21:22: " + getCheckMessage(MSG_KEY, "str1", "null"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckTest.java +index 9c74968f6..9b2f340c6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FallThroughCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class FallThroughCheckTest extends AbstractModuleTestSupport { ++final class FallThroughCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "22:13: " + getCheckMessage(MSG_FALL_THROUGH), + "46:13: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -65,13 +65,13 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResources() throws Exception { ++ void tryWithResources() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getNonCompilablePath("InputFallThrough.java"), expected); + } + + @Test +- public void testStringSwitch() throws Exception { ++ void stringSwitch() throws Exception { + final String[] expected = { + "21:9: " + getCheckMessage(MSG_FALL_THROUGH), + }; +@@ -79,7 +79,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCharacterSwitch() throws Exception { ++ void characterSwitch() throws Exception { + final String[] expected = { + "19:13: " + getCheckMessage(MSG_FALL_THROUGH), + "30:13: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -92,7 +92,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLastCaseGroup() throws Exception { ++ void lastCaseGroup() throws Exception { + final String[] expected = { + "22:13: " + getCheckMessage(MSG_FALL_THROUGH), + "46:13: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -119,7 +119,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOwnPattern() throws Exception { ++ void ownPattern() throws Exception { + + final String[] expected = { + "22:13: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -163,7 +163,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOwnPatternTryWithResources() throws Exception { ++ void ownPatternTryWithResources() throws Exception { + + final String[] expected = { + "54:9: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -176,7 +176,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithEmoji() throws Exception { ++ void withEmoji() throws Exception { + final String[] expected = { + "22:17: " + getCheckMessage(MSG_FALL_THROUGH), + "25:17: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -187,7 +187,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final FallThroughCheck check = new FallThroughCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -201,7 +201,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFallThroughNoElse() throws Exception { ++ void fallThroughNoElse() throws Exception { + final String[] expected = { + "28:13: " + getCheckMessage(MSG_FALL_THROUGH), + "43:13: " + getCheckMessage(MSG_FALL_THROUGH), +@@ -217,7 +217,7 @@ public class FallThroughCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testYield() throws Exception { ++ void yield() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_FALL_THROUGH), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckTest.java +index 41991caef..af5ca6618 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/FinalLocalVariableCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { ++final class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "17:13: " + getCheckMessage(MSG_KEY, "i"), +@@ -82,7 +82,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsInput() throws Exception { ++ void recordsInput() throws Exception { + final String[] expected = { + "20:17: " + getCheckMessage(MSG_KEY, "b"), + }; +@@ -91,7 +91,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParameter() throws Exception { ++ void parameter() throws Exception { + + final String[] expected = { + "53:28: " + getCheckMessage(MSG_KEY, "aArg"), +@@ -102,21 +102,21 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNativeMethods() throws Exception { ++ void nativeMethods() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFinalLocalVariableNativeMethods.java"), expected); + } + + @Test +- public void testFalsePositive() throws Exception { ++ void falsePositive() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFinalLocalVariableFalsePositive.java"), expected); + } + + @Test +- public void testEnhancedForLoopVariableTrue() throws Exception { ++ void enhancedForLoopVariableTrue() throws Exception { + final String[] expected = { + "16:20: " + getCheckMessage(MSG_KEY, "a"), + "23:13: " + getCheckMessage(MSG_KEY, "x"), +@@ -131,7 +131,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnhancedForLoopVariableFalse() throws Exception { ++ void enhancedForLoopVariableFalse() throws Exception { + final String[] expected = { + "23:13: " + getCheckMessage(MSG_KEY, "x"), + "29:66: " + getCheckMessage(MSG_KEY, "snippets"), +@@ -143,7 +143,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambda() throws Exception { ++ void lambda() throws Exception { + final String[] expected = { + "40:16: " + getCheckMessage(MSG_KEY, "result"), + }; +@@ -151,7 +151,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVariableNameShadowing() throws Exception { ++ void variableNameShadowing() throws Exception { + + final String[] expected = { + "12:28: " + getCheckMessage(MSG_KEY, "text"), "25:13: " + getCheckMessage(MSG_KEY, "x"), +@@ -160,7 +160,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImproperToken() { ++ void improperToken() { + final FinalLocalVariableCheck check = new FinalLocalVariableCheck(); + + final DetailAstImpl lambdaAst = new DetailAstImpl(); +@@ -175,7 +175,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVariableWhichIsAssignedMultipleTimes() throws Exception { ++ void variableWhichIsAssignedMultipleTimes() throws Exception { + + final String[] expected = { + "57:13: " + getCheckMessage(MSG_KEY, "i"), +@@ -190,7 +190,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVariableIsAssignedInsideAndOutsideSwitchBlock() throws Exception { ++ void variableIsAssignedInsideAndOutsideSwitchBlock() throws Exception { + final String[] expected = { + "39:13: " + getCheckMessage(MSG_KEY, "b"), + }; +@@ -199,7 +199,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalLocalVariableFalsePositives() throws Exception { ++ void finalLocalVariableFalsePositives() throws Exception { + final String[] expected = { + "352:16: " + getCheckMessage(MSG_KEY, "c2"), "2195:16: " + getCheckMessage(MSG_KEY, "b"), + }; +@@ -207,27 +207,27 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleAndNestedConditions() throws Exception { ++ void multipleAndNestedConditions() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputFinalLocalVariableMultipleAndNestedConditions.java"), expected); + } + + @Test +- public void testMultiTypeCatch() throws Exception { ++ void multiTypeCatch() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFinalLocalVariableMultiCatch.java"), expected); + } + + @Test +- public void testLeavingSlistToken() throws Exception { ++ void leavingSlistToken() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputFinalLocalVariableLeavingSlistToken.java"), expected); + } + + @Test +- public void testBreakOrReturn() throws Exception { ++ void breakOrReturn() throws Exception { + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY, "e"), + }; +@@ -235,7 +235,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnonymousClass() throws Exception { ++ void anonymousClass() throws Exception { + final String[] expected = { + "13:16: " + getCheckMessage(MSG_KEY, "testSupport"), + }; +@@ -243,14 +243,14 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReceiverParameter() throws Exception { ++ void receiverParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputFinalLocalVariableReceiverParameter.java"), expected); + } + + @Test +- public void testFinalLocalVariableSwitchExpressions() throws Exception { ++ void finalLocalVariableSwitchExpressions() throws Exception { + final String[] expected = { + "15:19: " + getCheckMessage(MSG_KEY, "e"), + "53:19: " + getCheckMessage(MSG_KEY, "e"), +@@ -262,7 +262,7 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalLocalVariableSwitchAssignment() throws Exception { ++ void finalLocalVariableSwitchAssignment() throws Exception { + final String[] expected = { + "21:13: " + getCheckMessage(MSG_KEY, "a"), + "44:13: " + getCheckMessage(MSG_KEY, "b"), +@@ -275,13 +275,13 @@ public class FinalLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalLocalVariableSwitchStatement() throws Exception { ++ void finalLocalVariableSwitchStatement() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFinalLocalVariableSwitchStatement.java"), expected); + } + + @Test +- public void testConstructor() throws Exception { ++ void constructor() throws Exception { + final String[] expected = { + "14:44: " + getCheckMessage(MSG_KEY, "a"), + "18:44: " + getCheckMessage(MSG_KEY, "a"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java +index df7146aa0..8d3321536 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheckTest.java +@@ -34,7 +34,7 @@ import java.util.Optional; + import java.util.function.Predicate; + import org.junit.jupiter.api.Test; + +-public class HiddenFieldCheckTest extends AbstractModuleTestSupport { ++final class HiddenFieldCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,7 +42,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticVisibilityFromLambdas() throws Exception { ++ void staticVisibilityFromLambdas() throws Exception { + final String[] expected = { + "31:34: " + getCheckMessage(MSG_KEY, "value"), + "63:31: " + getCheckMessage(MSG_KEY, "languageCode"), +@@ -65,7 +65,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticVisibilityFromAnonymousClasses() throws Exception { ++ void staticVisibilityFromAnonymousClasses() throws Exception { + final String[] expected = { + "22:45: " + getCheckMessage(MSG_KEY, "other"), + "28:42: " + getCheckMessage(MSG_KEY, "other"), +@@ -77,7 +77,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoParameters() throws Exception { ++ void noParameters() throws Exception { + final String[] expected = { + "30:13: " + getCheckMessage(MSG_KEY, "hidden"), + "39:13: " + getCheckMessage(MSG_KEY, "hidden"), +@@ -102,7 +102,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "30:13: " + getCheckMessage(MSG_KEY, "hidden"), + "33:34: " + getCheckMessage(MSG_KEY, "hidden"), +@@ -145,7 +145,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + + /** Tests ignoreFormat property. */ + @Test +- public void testIgnoreFormat() throws Exception { ++ void ignoreFormat() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HiddenFieldCheck.class); + checkConfig.addProperty("ignoreFormat", "^i.*$"); + assertWithMessage("Ignore format should not be null") +@@ -186,7 +186,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + + /** Tests ignoreSetter property. */ + @Test +- public void testIgnoreSetter() throws Exception { ++ void ignoreSetter() throws Exception { + final String[] expected = { + "30:13: " + getCheckMessage(MSG_KEY, "hidden"), + "33:34: " + getCheckMessage(MSG_KEY, "hidden"), +@@ -225,7 +225,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + + /** Tests ignoreSetter and setterCanReturnItsClass properties. */ + @Test +- public void testIgnoreChainSetter() throws Exception { ++ void ignoreChainSetter() throws Exception { + final String[] expected = { + "30:13: " + getCheckMessage(MSG_KEY, "hidden"), + "33:34: " + getCheckMessage(MSG_KEY, "hidden"), +@@ -262,7 +262,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + + /** Tests ignoreConstructorParameter property. */ + @Test +- public void testIgnoreConstructorParameter() throws Exception { ++ void ignoreConstructorParameter() throws Exception { + final String[] expected = { + "29:13: " + getCheckMessage(MSG_KEY, "hidden"), + "38:13: " + getCheckMessage(MSG_KEY, "hidden"), +@@ -302,7 +302,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + + /** Test against a class with field declarations in different order. */ + @Test +- public void testReordered() throws Exception { ++ void reordered() throws Exception { + final String[] expected = { + "30:13: " + getCheckMessage(MSG_KEY, "hidden"), + "33:40: " + getCheckMessage(MSG_KEY, "hidden"), +@@ -329,7 +329,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreAbstractMethods() throws Exception { ++ void ignoreAbstractMethods() throws Exception { + + final String[] expected = { + "30:13: " + getCheckMessage(MSG_KEY, "hidden"), +@@ -371,13 +371,13 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReceiverParameter() throws Exception { ++ void receiverParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputHiddenFieldReceiver.java"), expected); + } + + @Test +- public void testHiddenFieldEnhancedInstanceof() throws Exception { ++ void hiddenFieldEnhancedInstanceof() throws Exception { + + final String[] expected = { + "26:39: " + getCheckMessage(MSG_KEY, "price"), +@@ -388,7 +388,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHiddenFieldSwitchExpression() throws Exception { ++ void hiddenFieldSwitchExpression() throws Exception { + + final String[] expected = { + "28:13: " + getCheckMessage(MSG_KEY, "x"), +@@ -411,7 +411,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHiddenFieldRecords() throws Exception { ++ void hiddenFieldRecords() throws Exception { + + final String[] expected = { + "23:17: " + getCheckMessage(MSG_KEY, "myHiddenInt"), +@@ -428,7 +428,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHiddenFieldLambdasInNestedScope() throws Exception { ++ void hiddenFieldLambdasInNestedScope() throws Exception { + final String[] expected = { + "21:34: " + getCheckMessage(MSG_KEY, "value"), + }; +@@ -436,7 +436,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassNestedInRecord() throws Exception { ++ void classNestedInRecord() throws Exception { + + final String[] expected = { + "23:26: " + getCheckMessage(MSG_KEY, "a"), +@@ -452,7 +452,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final HiddenFieldCheck check = new HiddenFieldCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -464,7 +464,7 @@ public class HiddenFieldCheckTest extends AbstractModuleTestSupport { + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +- check, classDef.get(), "frame", new CheckIfStatefulFieldCleared())) ++ check, classDef.orElseThrow(), "frame", new CheckIfStatefulFieldCleared())) + .isTrue(); + } + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java +index 4c882e6ce..107d6e790 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalCatchCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck.MS + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class IllegalCatchCheckTest extends AbstractModuleTestSupport { ++final class IllegalCatchCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "14:11: " + getCheckMessage(MSG_KEY, "RuntimeException"), +@@ -48,7 +48,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalClassNames() throws Exception { ++ void illegalClassNames() throws Exception { + final String[] expected = { + "14:11: " + getCheckMessage(MSG_KEY, "Exception"), + "15:11: " + getCheckMessage(MSG_KEY, "Throwable"), +@@ -60,7 +60,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalClassNamesBad() throws Exception { ++ void illegalClassNamesBad() throws Exception { + // check that incorrect names don't break the Check + final String[] expected = { + "15:11: " + getCheckMessage(MSG_KEY, "Exception"), +@@ -71,7 +71,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleTypes() throws Exception { ++ void multipleTypes() throws Exception { + final String[] expected = { + "15:11: " + getCheckMessage(MSG_KEY, "RuntimeException"), + "15:11: " + getCheckMessage(MSG_KEY, "SQLException"), +@@ -90,7 +90,7 @@ public class IllegalCatchCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final IllegalCatchCheck check = new IllegalCatchCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckTest.java +index ab1d5748e..c216ef716 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalInstantiationCheckTest.java +@@ -34,7 +34,7 @@ import java.util.Collection; + import java.util.Optional; + import org.junit.jupiter.api.Test; + +-public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { ++final class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,13 +42,13 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputIllegalInstantiationSemantic.java"), expected); + } + + @Test +- public void testClasses() throws Exception { ++ void classes() throws Exception { + final String[] expected = { + "24:21: " + getCheckMessage(MSG_KEY, "java.lang.Boolean"), + "29:21: " + getCheckMessage(MSG_KEY, "java.lang.Boolean"), +@@ -65,20 +65,20 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSameClassNameAsJavaLang() throws Exception { ++ void sameClassNameAsJavaLang() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputIllegalInstantiationSameClassNameJavaLang.java"), expected); + } + + @Test +- public void testJava8() throws Exception { ++ void java8() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputIllegalInstantiation.java"), expected); + } + + @Test +- public void testNoPackage() throws Exception { ++ void noPackage() throws Exception { + final String[] expected = { + "10:20: " + getCheckMessage(MSG_KEY, "java.lang.Boolean"), + }; +@@ -86,7 +86,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavaLangPackage() throws Exception { ++ void javaLangPackage() throws Exception { + final String[] expected = { + "13:19: " + getCheckMessage(MSG_KEY, "java.lang.Boolean"), + "21:20: " + getCheckMessage(MSG_KEY, "java.lang.String"), +@@ -96,27 +96,27 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongPackage() throws Exception { ++ void wrongPackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputIllegalInstantiationLang2.java"), expected); + } + + @Test +- public void testJavaLangPackage3() throws Exception { ++ void javaLangPackage3() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputIllegalInstantiationLang3.java"), expected); + } + + @Test +- public void testNameSimilarToStandardClass() throws Exception { ++ void nameSimilarToStandardClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputIllegalInstantiationNameSimilarToStandardClasses.java"), expected); + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -130,7 +130,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImproperToken() { ++ void improperToken() { + final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); + + final DetailAstImpl lambdaAst = new DetailAstImpl(); +@@ -150,9 +150,9 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearStateClassNames() throws Exception { ++ @Test ++ void clearStateClassNames() throws Exception { + final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -166,7 +166,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- classDef.get(), ++ classDef.orElseThrow(), + "classNames", + classNames -> ((Collection) classNames).isEmpty())) + .isTrue(); +@@ -179,7 +179,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testClearStateImports() throws Exception { ++ void clearStateImports() throws Exception { + final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -192,7 +192,10 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +- check, importDef.get(), "imports", imports -> ((Collection) imports).isEmpty())) ++ check, ++ importDef.orElseThrow(), ++ "imports", ++ imports -> ((Collection) imports).isEmpty())) + .isTrue(); + } + +@@ -202,9 +205,9 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearStateInstantiations() throws Exception { ++ @Test ++ void clearStateInstantiations() throws Exception { + final IllegalInstantiationCheck check = new IllegalInstantiationCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -218,7 +221,7 @@ public class IllegalInstantiationCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- literalNew.get(), ++ literalNew.orElseThrow(), + "instantiations", + instantiations -> ((Collection) instantiations).isEmpty())) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheckTest.java +index 34f79a887..a809b6a96 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalThrowsCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { ++final class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "19:51: " + getCheckMessage(MSG_KEY, "RuntimeException"), +@@ -46,7 +46,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalClassNames() throws Exception { ++ void illegalClassNames() throws Exception { + // check that incorrect names don't break the Check + final String[] expected = { + "15:33: " + getCheckMessage(MSG_KEY, "NullPointerException"), +@@ -58,7 +58,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + + /** Test to validate the IllegalThrowsCheck with ignoredMethodNames attribute. */ + @Test +- public void testIgnoreMethodNames() throws Exception { ++ void ignoreMethodNames() throws Exception { + + final String[] expected = { + "19:51: " + getCheckMessage(MSG_KEY, "RuntimeException"), +@@ -70,7 +70,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + + /** Test to validate the IllegalThrowsCheck with both the attributes specified. */ + @Test +- public void testIllegalClassNamesWithIgnoreMethodNames() throws Exception { ++ void illegalClassNamesWithIgnoreMethodNames() throws Exception { + final String[] expected = { + "14:33: " + getCheckMessage(MSG_KEY, "NullPointerException"), + "27:35: " + getCheckMessage(MSG_KEY, "Throwable"), +@@ -81,7 +81,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + + /** Test to validate the IllegalThrowsCheck with ignoreOverriddenMethods property. */ + @Test +- public void testIgnoreOverriddenMethods() throws Exception { ++ void ignoreOverriddenMethods() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -91,7 +91,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + + /** Test to validate the IllegalThrowsCheck without ignoreOverriddenMethods property. */ + @Test +- public void testNotIgnoreOverriddenMethods() throws Exception { ++ void notIgnoreOverriddenMethods() throws Exception { + + final String[] expected = { + "17:36: " + getCheckMessage(MSG_KEY, "RuntimeException"), +@@ -103,7 +103,7 @@ public class IllegalThrowsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final IllegalThrowsCheck check = new IllegalThrowsCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckTest.java +index 8dd2dd93b..a98da2e7b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenCheckTest.java +@@ -20,14 +20,14 @@ + package com.puppycrawl.tools.checkstyle.checks.coding; + + import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck.MSG_KEY; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; + import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; +-import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.Test; + +-public class IllegalTokenCheckTest extends AbstractModuleTestSupport { ++final class IllegalTokenCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckWithDefaultSettings() throws Exception { ++ void checkWithDefaultSettings() throws Exception { + final String[] expected = { + "36:14: " + getCheckMessage(MSG_KEY, "label:"), + "38:25: " + getCheckMessage(MSG_KEY, "anotherLabel:"), +@@ -44,7 +44,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPreviouslyIllegalTokens() throws Exception { ++ void previouslyIllegalTokens() throws Exception { + final String[] expected = { + "18:9: " + getCheckMessage(MSG_KEY, "switch"), + "21:18: " + getCheckMessage(MSG_KEY, "--"), +@@ -54,7 +54,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNative() throws Exception { ++ void testNative() throws Exception { + final String[] expected = { + "27:12: " + getCheckMessage(MSG_KEY, "native"), + }; +@@ -62,10 +62,10 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentContentToken() throws Exception { ++ void commentContentToken() throws Exception { + + final String path = getPath("InputIllegalTokens4.java"); +- final String lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); ++ final String lineSeparator = CheckUtil.getLineSeparatorForFile(path, UTF_8); + final String[] expected = { + "1:3: " + + getCheckMessage( +@@ -99,7 +99,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlockCommentBeginToken() throws Exception { ++ void blockCommentBeginToken() throws Exception { + + final String[] expected = { + "1:1: " + getCheckMessage(MSG_KEY, "/*"), "10:1: " + getCheckMessage(MSG_KEY, "/*"), +@@ -108,7 +108,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlockCommentEndToken() throws Exception { ++ void blockCommentEndToken() throws Exception { + + final String[] expected = { + "6:1: " + getCheckMessage(MSG_KEY, "*/"), "12:2: " + getCheckMessage(MSG_KEY, "*/"), +@@ -117,7 +117,7 @@ public class IllegalTokenCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleLineCommentToken() throws Exception { ++ void singleLineCommentToken() throws Exception { + + final String[] expected = { + "38:27: " + getCheckMessage(MSG_KEY, "//"), "42:26: " + getCheckMessage(MSG_KEY, "//"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckTest.java +index 03e6fd9be..39c8579c0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTokenTextCheckTest.java +@@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.checks.coding; + + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.MSG_KEY; ++import static java.util.regex.Pattern.CASE_INSENSITIVE; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; +@@ -31,7 +32,7 @@ import java.util.List; + import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; + +-public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { ++final class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +40,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseSensitive() throws Exception { ++ void caseSensitive() throws Exception { + final String[] expected = { + "34:28: " + getCheckMessage(MSG_KEY, "a href"), + }; +@@ -47,7 +48,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseInSensitive() throws Exception { ++ void caseInSensitive() throws Exception { + final String[] expected = { + "34:28: " + getCheckMessage(MSG_KEY, "a href"), + "35:32: " + getCheckMessage(MSG_KEY, "a href"), +@@ -56,7 +57,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomMessage() throws Exception { ++ void customMessage() throws Exception { + + final String[] expected = { + "34:28: " + "My custom message", +@@ -65,7 +66,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullCustomMessage() throws Exception { ++ void nullCustomMessage() throws Exception { + + final String[] expected = { + "34:28: " + getCheckMessage(MSG_KEY, "a href"), +@@ -74,7 +75,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTokenTextTextBlocks() throws Exception { ++ void illegalTokenTextTextBlocks() throws Exception { + + final String[] expected = { + "16:28: " + getCheckMessage(MSG_KEY, "a href"), +@@ -88,7 +89,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTokenTextTextBlocksQuotes() throws Exception { ++ void illegalTokenTextTextBlocksQuotes() throws Exception { + + final String[] expected = { + "16:28: " + getCheckMessage(MSG_KEY, "\""), +@@ -104,7 +105,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final IllegalTokenTextCheck check = new IllegalTokenTextCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -121,7 +122,7 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentToken() throws Exception { ++ void commentToken() throws Exception { + + final String[] expected = { + "1:3: " + getCheckMessage(MSG_KEY, "a href"), "45:28: " + getCheckMessage(MSG_KEY, "a href"), +@@ -130,19 +131,19 @@ public class IllegalTokenTextCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOrderOfProperties() { ++ void orderOfProperties() { + // pure class must be used as configuration doesn't guarantee order of + // attributes + final IllegalTokenTextCheck check = new IllegalTokenTextCheck(); + check.setFormat("test"); + check.setIgnoreCase(true); + final Pattern actual = TestUtil.getInternalState(check, "format"); +- assertWithMessage("should match").that(actual.flags()).isEqualTo(Pattern.CASE_INSENSITIVE); ++ assertWithMessage("should match").that(actual.flags()).isEqualTo(CASE_INSENSITIVE); + assertWithMessage("should match").that(actual.pattern()).isEqualTo("test"); + } + + @Test +- public void testAcceptableTokensMakeSense() { ++ void acceptableTokensMakeSense() { + final int expectedTokenTypesTotalNumber = 186; + assertWithMessage( + "Total number of TokenTypes has changed, acceptable tokens in" +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckTest.java +index d5ea9a091..e49e5bc4c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/IllegalTypeCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import org.junit.jupiter.api.Test; + +-public class IllegalTypeCheckTest extends AbstractModuleTestSupport { ++final class IllegalTypeCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,7 +38,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateAbstractClassNamesSetToTrue() throws Exception { ++ void validateAbstractClassNamesSetToTrue() throws Exception { + final String[] expected = { + "27:38: " + getCheckMessage(MSG_KEY, "AbstractClass"), + "44:5: " + getCheckMessage(MSG_KEY, "AbstractClass"), +@@ -51,7 +51,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateAbstractClassNamesSetToFalse() throws Exception { ++ void validateAbstractClassNamesSetToFalse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -59,7 +59,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaults() throws Exception { ++ void defaults() throws Exception { + final String[] expected = { + "34:13: " + getCheckMessage(MSG_KEY, "java.util.TreeSet"), + "35:13: " + getCheckMessage(MSG_KEY, "TreeSet"), +@@ -71,7 +71,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultsEmptyStringMemberModifiers() throws Exception { ++ void defaultsEmptyStringMemberModifiers() throws Exception { + + final String[] expected = { + "34:13: " + getCheckMessage(MSG_KEY, "java.util.TreeSet"), +@@ -85,7 +85,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreMethodNames() throws Exception { ++ void ignoreMethodNames() throws Exception { + final String[] expected = { + "23:13: " + getCheckMessage(MSG_KEY, "AbstractClass"), + "26:13: " +@@ -103,7 +103,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFormat() throws Exception { ++ void format() throws Exception { + + final String[] expected = { + "34:13: " + getCheckMessage(MSG_KEY, "java.util.TreeSet"), +@@ -116,7 +116,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLegalAbstractClassNames() throws Exception { ++ void legalAbstractClassNames() throws Exception { + + final String[] expected = { + "26:13: " +@@ -135,7 +135,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSameFileNameFalsePositive() throws Exception { ++ void sameFileNameFalsePositive() throws Exception { + final String[] expected = { + "28:5: " + getCheckMessage(MSG_KEY, "SubCal"), + "43:5: " + getCheckMessage(MSG_KEY, "java.util.List"), +@@ -146,7 +146,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSameFileNameGeneral() throws Exception { ++ void sameFileNameGeneral() throws Exception { + final String[] expected = { + "25:5: " + getCheckMessage(MSG_KEY, "InputIllegalTypeGregCal"), + "29:43: " + getCheckMessage(MSG_KEY, "InputIllegalTypeGregCal"), +@@ -161,7 +161,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayTypes() throws Exception { ++ void arrayTypes() throws Exception { + final String[] expected = { + "20:12: " + getCheckMessage(MSG_KEY, "Boolean[]"), + "22:12: " + getCheckMessage(MSG_KEY, "Boolean[][]"), +@@ -174,7 +174,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPlainAndArrayTypes() throws Exception { ++ void plainAndArrayTypes() throws Exception { + final String[] expected = { + "20:12: " + getCheckMessage(MSG_KEY, "Boolean"), + "24:12: " + getCheckMessage(MSG_KEY, "Boolean[][]"), +@@ -186,7 +186,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGenerics() throws Exception { ++ void generics() throws Exception { + final String[] expected = { + "28:16: " + getCheckMessage(MSG_KEY, "Boolean"), + "29:31: " + getCheckMessage(MSG_KEY, "Boolean"), +@@ -210,7 +210,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExtendsImplements() throws Exception { ++ void extendsImplements() throws Exception { + final String[] expected = { + "24:17: " + getCheckMessage(MSG_KEY, "Hashtable"), + "25:14: " + getCheckMessage(MSG_KEY, "Boolean"), +@@ -226,7 +226,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStarImports() throws Exception { ++ void starImports() throws Exception { + + final String[] expected = { + "25:5: " + getCheckMessage(MSG_KEY, "List"), +@@ -236,7 +236,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticImports() throws Exception { ++ void staticImports() throws Exception { + + final String[] expected = { + "28:6: " + getCheckMessage(MSG_KEY, "SomeStaticClass"), +@@ -247,7 +247,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMemberModifiers() throws Exception { ++ void memberModifiers() throws Exception { + final String[] expected = { + "22:13: " + getCheckMessage(MSG_KEY, "AbstractClass"), + "25:13: " + getCheckMessage(MSG_KEY, "java.util.AbstractList"), +@@ -262,7 +262,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageClassName() throws Exception { ++ void packageClassName() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -270,7 +270,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearDataBetweenFiles() throws Exception { ++ void clearDataBetweenFiles() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IllegalTypeCheck.class); + final String violationFile = getPath("InputIllegalTypeTestClearDataBetweenFiles.java"); + checkConfig.addProperty("illegalClassNames", "java.util.TreeSet"); +@@ -289,7 +289,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTypeEnhancedInstanceof() throws Exception { ++ void illegalTypeEnhancedInstanceof() throws Exception { + final String[] expected = { + "28:9: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), + "31:28: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), +@@ -303,7 +303,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTypeRecordsAndCompactCtors() throws Exception { ++ void illegalTypeRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "27:14: " + getCheckMessage(MSG_KEY, "LinkedHashMap"), + "31:52: " + getCheckMessage(MSG_KEY, "Cloneable"), +@@ -319,7 +319,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalTypeNewArrayStructure() throws Exception { ++ void illegalTypeNewArrayStructure() throws Exception { + + final String[] expected = { + "26:13: " + getCheckMessage(MSG_KEY, "HashMap"), +@@ -329,7 +329,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentsDefault() throws Exception { ++ void recordComponentsDefault() throws Exception { + final String[] expected = { + "45:9: " + getCheckMessage(MSG_KEY, "HashSet"), + "53:23: " + getCheckMessage(MSG_KEY, "HashSet"), +@@ -340,7 +340,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentsFinal() throws Exception { ++ void recordComponentsFinal() throws Exception { + final String[] expected = { + "45:9: " + getCheckMessage(MSG_KEY, "HashSet"), + "53:23: " + getCheckMessage(MSG_KEY, "HashSet"), +@@ -351,7 +351,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentsPrivateFinal() throws Exception { ++ void recordComponentsPrivateFinal() throws Exception { + final String[] expected = { + "45:9: " + getCheckMessage(MSG_KEY, "HashSet"), + "53:23: " + getCheckMessage(MSG_KEY, "HashSet"), +@@ -363,7 +363,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentsPublicProtectedStatic() throws Exception { ++ void recordComponentsPublicProtectedStatic() throws Exception { + final String[] expected = {"45:9: " + getCheckMessage(MSG_KEY, "HashSet")}; + + verifyWithInlineConfigParser( +@@ -373,13 +373,13 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrailingWhitespaceInConfig() throws Exception { ++ void trailingWhitespaceInConfig() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputIllegalTypeWhitespaceInConfig.java"), expected); + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final IllegalTypeCheck check = new IllegalTypeCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -393,7 +393,7 @@ public class IllegalTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImproperToken() { ++ void improperToken() { + final IllegalTypeCheck check = new IllegalTypeCheck(); + + final DetailAstImpl classDefAst = new DetailAstImpl(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckTest.java +index 043756074..259809a26 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/InnerAssignmentCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { ++final class InnerAssignmentCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "22:15: " + getCheckMessage(MSG_KEY), + "22:19: " + getCheckMessage(MSG_KEY), +@@ -59,13 +59,13 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaExpression() throws Exception { ++ void lambdaExpression() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputInnerAssignmentLambdaExpressions.java"), expected); + } + + @Test +- public void testInnerAssignmentNotInLoopContext() throws Exception { ++ void innerAssignmentNotInLoopContext() throws Exception { + final String[] expected = { + "12:28: " + getCheckMessage(MSG_KEY), + }; +@@ -73,7 +73,7 @@ public class InnerAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final InnerAssignmentCheck check = new InnerAssignmentCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckTest.java +index 9c89f6095..1cfba9a61 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MagicNumberCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MagicNumberCheckTest extends AbstractModuleTestSupport { ++final class MagicNumberCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,13 +33,13 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLocalVariables() throws Exception { ++ void localVariables() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMagicNumber_8.java"), expected); + } + + @Test +- public void testLocalVariables2() throws Exception { ++ void localVariables2() throws Exception { + final String[] expected = { + "25:17: " + getCheckMessage(MSG_KEY, "8"), + }; +@@ -47,7 +47,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "54:26: " + getCheckMessage(MSG_KEY, "3_000"), + "55:32: " + getCheckMessage(MSG_KEY, "1.5_0"), +@@ -100,7 +100,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreSome() throws Exception { ++ void ignoreSome() throws Exception { + final String[] expected = { + "36:25: " + getCheckMessage(MSG_KEY, "2"), + "42:35: " + getCheckMessage(MSG_KEY, "2"), +@@ -146,7 +146,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreNone() throws Exception { ++ void ignoreNone() throws Exception { + final String[] expected = { + "41:24: " + getCheckMessage(MSG_KEY, "1"), + "42:25: " + getCheckMessage(MSG_KEY, "2"), +@@ -220,7 +220,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIntegersOnly() throws Exception { ++ void integersOnly() throws Exception { + final String[] expected = { + "55:26: " + getCheckMessage(MSG_KEY, "3_000"), + "57:27: " + getCheckMessage(MSG_KEY, "3"), +@@ -265,7 +265,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreNegativeOctalHex() throws Exception { ++ void ignoreNegativeOctalHex() throws Exception { + final String[] expected = { + "55:26: " + getCheckMessage(MSG_KEY, "3_000"), + "57:27: " + getCheckMessage(MSG_KEY, "3"), +@@ -305,7 +305,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreHashCodeMethod() throws Exception { ++ void ignoreHashCodeMethod() throws Exception { + final String[] expected = { + "55:26: " + getCheckMessage(MSG_KEY, "3_000"), + "56:32: " + getCheckMessage(MSG_KEY, "1.5_0"), +@@ -353,7 +353,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreFieldDeclaration() throws Exception { ++ void ignoreFieldDeclaration() throws Exception { + final String[] expected = { + "55:26: " + getCheckMessage(MSG_KEY, "3_000"), + "56:32: " + getCheckMessage(MSG_KEY, "1.5_0"), +@@ -392,7 +392,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWaiverParentToken() throws Exception { ++ void waiverParentToken() throws Exception { + final String[] expected = { + "55:26: " + getCheckMessage(MSG_KEY, "3_000"), + "56:32: " + getCheckMessage(MSG_KEY, "1.5_0"), +@@ -451,7 +451,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMagicNumberRecordsDefault() throws Exception { ++ void magicNumberRecordsDefault() throws Exception { + final String[] expected = { + "19:11: " + getCheckMessage(MSG_KEY, "6"), + "21:36: " + getCheckMessage(MSG_KEY, "7"), +@@ -464,7 +464,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMagicNumberIgnoreFieldDeclarationRecords() throws Exception { ++ void magicNumberIgnoreFieldDeclarationRecords() throws Exception { + final String[] expected = { + "19:11: " + getCheckMessage(MSG_KEY, "6"), + "25:29: " + getCheckMessage(MSG_KEY, "8"), +@@ -476,7 +476,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreInAnnotationElementDefault() throws Exception { ++ void ignoreInAnnotationElementDefault() throws Exception { + final String[] expected = { + "18:29: " + getCheckMessage(MSG_KEY, "10"), "19:33: " + getCheckMessage(MSG_KEY, "11"), + }; +@@ -484,7 +484,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMagicNumber() throws Exception { ++ void magicNumber() throws Exception { + final String[] expected = { + "38:29: " + getCheckMessage(MSG_KEY, "3.0"), + "39:32: " + getCheckMessage(MSG_KEY, "1.5_0"), +@@ -523,7 +523,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMagicNumber2() throws Exception { ++ void magicNumber2() throws Exception { + final String[] expected = { + "25:17: " + getCheckMessage(MSG_KEY, "9"), + "27:20: " + getCheckMessage(MSG_KEY, "5.5"), +@@ -547,7 +547,7 @@ public class MagicNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMagicNumber3() throws Exception { ++ void magicNumber3() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMagicNumber_12.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckTest.java +index 8234920bd..3ff1aeb4f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MatchXpathCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MatchXpathCheckTest extends AbstractModuleTestSupport { ++final class MatchXpathCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,25 +35,25 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckWithEmptyQuery() throws Exception { ++ void checkWithEmptyQuery() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMatchXpath.java"), expected); + } + + @Test +- public void testNoStackoverflowError() throws Exception { ++ void noStackoverflowError() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMatchXpathNoStackoverflowError.java"), expected); + } + + @Test +- public void testCheckWithImplicitEmptyQuery() throws Exception { ++ void checkWithImplicitEmptyQuery() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMatchXpath2.java"), expected); + } + + @Test +- public void testCheckWithMatchingMethodNames() throws Exception { ++ void checkWithMatchingMethodNames() throws Exception { + final String[] expected = { + "11:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), + "13:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), +@@ -62,13 +62,13 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckWithNoMatchingMethodName() throws Exception { ++ void checkWithNoMatchingMethodName() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMatchXpath4.java"), expected); + } + + @Test +- public void testCheckWithSingleLineCommentsStartsWithSpace() throws Exception { ++ void checkWithSingleLineCommentsStartsWithSpace() throws Exception { + final String[] expected = { + "13:25: " + getCheckMessage(MatchXpathCheck.MSG_KEY), + "14:27: " + getCheckMessage(MatchXpathCheck.MSG_KEY), +@@ -77,7 +77,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckWithBlockComments() throws Exception { ++ void checkWithBlockComments() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), + "14:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), +@@ -86,7 +86,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckWithMultilineComments() throws Exception { ++ void checkWithMultilineComments() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), + "20:5: " + getCheckMessage(MatchXpathCheck.MSG_KEY), +@@ -95,7 +95,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckWithDoubleBraceInitialization() throws Exception { ++ void checkWithDoubleBraceInitialization() throws Exception { + final String[] expected = { + "18:35: Do not use double-brace initialization", + }; +@@ -103,7 +103,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImitateIllegalThrowsCheck() throws Exception { ++ void imitateIllegalThrowsCheck() throws Exception { + final String[] expected = { + "13:25: Illegal throws statement", + "15:25: Illegal throws statement", +@@ -113,7 +113,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImitateExecutableStatementCountCheck() throws Exception { ++ void imitateExecutableStatementCountCheck() throws Exception { + final String[] expected = { + "25:5: Executable number of statements exceed threshold", + }; +@@ -121,7 +121,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForbidPrintStackTrace() throws Exception { ++ void forbidPrintStackTrace() throws Exception { + final String[] expected = { + "18:27: printStackTrace() method calls are forbidden", + }; +@@ -129,7 +129,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForbidParameterizedConstructor() throws Exception { ++ void forbidParameterizedConstructor() throws Exception { + final String[] expected = { + "13:5: Parameterized constructors are not allowed", + "15:5: Parameterized constructors are not allowed", +@@ -139,7 +139,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAvoidInstanceCreationWithoutVar() throws Exception { ++ void avoidInstanceCreationWithoutVar() throws Exception { + final String[] expected = { + "13:9: " + getCheckMessage(MatchXpathCheck.MSG_KEY), + }; +@@ -148,7 +148,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidQuery() { ++ void invalidQuery() { + final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); + + try { +@@ -160,7 +160,7 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEvaluationException() { ++ void evaluationException() { + final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); + matchXpathCheck.setQuery("count(*) div 0"); + +@@ -179,19 +179,19 @@ public class MatchXpathCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetDefaultTokens() { ++ void getDefaultTokens() { + final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); + assertWithMessage("Expected empty array").that(matchXpathCheck.getDefaultTokens()).isEmpty(); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); + assertWithMessage("Expected empty array").that(matchXpathCheck.getAcceptableTokens()).isEmpty(); + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MatchXpathCheck matchXpathCheck = new MatchXpathCheck(); + assertWithMessage("Expected empty array").that(matchXpathCheck.getRequiredTokens()).isEmpty(); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckTest.java +index 8de3fa4d1..2b57ee560 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingCtorCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.MissingCtorCheck.MSG + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class MissingCtorCheckTest extends AbstractModuleTestSupport { ++final class MissingCtorCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class MissingCtorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefault() throws Exception { ++ void missingSwitchDefault() throws Exception { + + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), +@@ -43,7 +43,7 @@ public class MissingCtorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final MissingCtorCheck check = new MissingCtorCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -57,7 +57,7 @@ public class MissingCtorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingCtorClassOnOneLine() throws Exception { ++ void missingCtorClassOnOneLine() throws Exception { + + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckTest.java +index 9e9309730..50b770ad5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MissingSwitchDefaultCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { ++final class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefault() throws Exception { ++ void missingSwitchDefault() throws Exception { + final String[] expected = { + "23:9: " + getCheckMessage(MSG_KEY, "default"), + "35:17: " + getCheckMessage(MSG_KEY, "default"), +@@ -45,7 +45,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final MissingSwitchDefaultCheck check = new MissingSwitchDefaultCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -59,7 +59,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefaultSwitchExpressions() throws Exception { ++ void missingSwitchDefaultSwitchExpressions() throws Exception { + final String[] expected = { + "14:9: " + getCheckMessage(MSG_KEY, "default"), + }; +@@ -68,7 +68,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefaultSwitchExpressionsTwo() throws Exception { ++ void missingSwitchDefaultSwitchExpressionsTwo() throws Exception { + final String[] expected = { + "14:9: " + getCheckMessage(MSG_KEY, "default"), + "26:9: " + getCheckMessage(MSG_KEY, "default"), +@@ -78,7 +78,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefaultSwitchExpressionsThree() throws Exception { ++ void missingSwitchDefaultSwitchExpressionsThree() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputMissingSwitchDefaultCheckSwitchExpressionsThree.java"), +@@ -86,7 +86,7 @@ public class MissingSwitchDefaultCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingSwitchDefaultCaseLabelElements() throws Exception { ++ void missingSwitchDefaultCaseLabelElements() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputMissingSwitchDefaultCaseLabelElements.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckTest.java +index f3485a184..2ab1569e2 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ModifiedControlVariableCheckTest.java +@@ -35,7 +35,7 @@ import java.util.Optional; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport { ++final class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -43,7 +43,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testModifiedControlVariable() throws Exception { ++ void modifiedControlVariable() throws Exception { + final String[] expected = { + "17:14: " + getCheckMessage(MSG_KEY, "i"), + "20:15: " + getCheckMessage(MSG_KEY, "i"), +@@ -60,7 +60,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testEnhancedForLoopVariableTrue() throws Exception { ++ void enhancedForLoopVariableTrue() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -68,7 +68,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testEnhancedForLoopVariableFalse() throws Exception { ++ void enhancedForLoopVariableFalse() throws Exception { + + final String[] expected = { + "16:18: " + getCheckMessage(MSG_KEY, "line"), +@@ -78,7 +78,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testEnhancedForLoopVariable2() throws Exception { ++ void enhancedForLoopVariable2() throws Exception { + + final String[] expected = { + "21:18: " + getCheckMessage(MSG_KEY, "i"), +@@ -88,7 +88,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final ModifiedControlVariableCheck check = new ModifiedControlVariableCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -102,7 +102,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testImproperToken() { ++ void improperToken() { + final ModifiedControlVariableCheck check = new ModifiedControlVariableCheck(); + + final DetailAstImpl classDefAst = new DetailAstImpl(); +@@ -124,7 +124,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testVariousAssignments() throws Exception { ++ void variousAssignments() throws Exception { + final String[] expected = { + "14:15: " + getCheckMessage(MSG_KEY, "i"), + "15:15: " + getCheckMessage(MSG_KEY, "k"), +@@ -159,9 +159,9 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearState() throws Exception { ++ @Test ++ void clearState() throws Exception { + final ModifiedControlVariableCheck check = new ModifiedControlVariableCheck(); + final Optional methodDef = + TestUtil.findTokenInAstByPredicate( +@@ -175,7 +175,7 @@ public class ModifiedControlVariableCheckTest extends AbstractModuleTestSupport + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- methodDef.get(), ++ methodDef.orElseThrow(), + "variableStack", + variableStack -> ((Collection>) variableStack).isEmpty())) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckTest.java +index a15675983..3eb93aea8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleStringLiteralsCheckTest.java +@@ -31,7 +31,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { ++final class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +39,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + + final String[] expected = { + "14:16: " + getCheckMessage(MSG_KEY, "\"StringContents\"", 3), +@@ -51,7 +51,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testItIgnoreEmpty() throws Exception { ++ void itIgnoreEmpty() throws Exception { + + final String[] expected = { + "14:16: " + getCheckMessage(MSG_KEY, "\"StringContents\"", 3), +@@ -62,7 +62,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleInputs() throws Exception { ++ void multipleInputs() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(MultipleStringLiteralsCheck.class); + checkConfig.addProperty("allowedDuplicates", "2"); + +@@ -84,7 +84,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testItIgnoreEmptyAndComspace() throws Exception { ++ void itIgnoreEmptyAndComspace() throws Exception { + + final String[] expected = { + "14:16: " + getCheckMessage(MSG_KEY, "\"StringContents\"", 3), +@@ -94,7 +94,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testItWithoutIgnoringAnnotations() throws Exception { ++ void itWithoutIgnoringAnnotations() throws Exception { + + final String[] expected = { + "28:23: " + getCheckMessage(MSG_KEY, "\"unchecked\"", 4), +@@ -104,7 +104,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final MultipleStringLiteralsCheck check = new MultipleStringLiteralsCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -118,7 +118,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = { + "14:16: " + getCheckMessage(MSG_KEY, "\"StringContents\"", 3), + "16:17: " + getCheckMessage(MSG_KEY, "\"DoubleString\"", 2), +@@ -129,7 +129,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnores() throws Exception { ++ void ignores() throws Exception { + final String[] expected = { + "28:23: " + getCheckMessage(MSG_KEY, "\"unchecked\"", 4), + }; +@@ -138,7 +138,7 @@ public class MultipleStringLiteralsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleStringLiteralsTextBlocks() throws Exception { ++ void multipleStringLiteralsTextBlocks() throws Exception { + + final String[] expected = { + "14:22: " + getCheckMessage(MSG_KEY, "\"string\"", 3), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheckTest.java +index b092f112b..88fb105ff 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/MultipleVariableDeclarationsCheckTest.java +@@ -26,7 +26,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDecl + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSupport { ++final class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + + final String[] expected = { + "11:5: " + getCheckMessage(MSG_MULTIPLE_COMMA), +@@ -52,7 +52,7 @@ public class MultipleVariableDeclarationsCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final MultipleVariableDeclarationsCheck check = new MultipleVariableDeclarationsCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java +index d9cadeb55..0e173c29e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedForDepthCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NestedForDepthCheckTest extends AbstractModuleTestSupport { ++final class NestedForDepthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,7 +41,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { + * @throws Exception necessary to fulfill JUnit's interface-requirements for test-methods. + */ + @Test +- public void testNestedTooDeep() throws Exception { ++ void nestedTooDeep() throws Exception { + + final String[] expected = { + "32:11: " + getCheckMessage(MSG_KEY, 3, 2), +@@ -60,7 +60,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { + * @throws Exception necessary to fulfill JUnit's interface-requirements for test-methods. + */ + @Test +- public void testNestedOk() throws Exception { ++ void nestedOk() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -68,7 +68,7 @@ public class NestedForDepthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final NestedForDepthCheck check = new NestedForDepthCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckTest.java +index 61a4b3de8..71b58c83d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedIfDepthCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { ++final class NestedIfDepthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "26:17: " + getCheckMessage(MSG_KEY, 2, 1), "52:17: " + getCheckMessage(MSG_KEY, 2, 1), +@@ -44,7 +44,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomizedDepth() throws Exception { ++ void customizedDepth() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -52,7 +52,7 @@ public class NestedIfDepthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final NestedIfDepthCheck check = new NestedIfDepthCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheckTest.java +index 004f513e2..ba7f94a2a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NestedTryDepthCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck. + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { ++final class NestedTryDepthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "29:17: " + getCheckMessage(MSG_KEY, 2, 1), +@@ -45,7 +45,7 @@ public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomizedDepth() throws Exception { ++ void customizedDepth() throws Exception { + + final String[] expected = { + "41:21: " + getCheckMessage(MSG_KEY, 3, 2), +@@ -55,7 +55,7 @@ public class NestedTryDepthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final NestedTryDepthCheck check = new NestedTryDepthCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckTest.java +index 5b16603ed..ed2d5b99e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoArrayTrailingCommaCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NoArrayTrailingComma + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { ++final class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { + + @Override + public String getPackageLocation() { +@@ -33,7 +33,7 @@ public class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "20:14: " + getCheckMessage(MSG_KEY), + "25:32: " + getCheckMessage(MSG_KEY), +@@ -47,7 +47,7 @@ public class NoArrayTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final NoArrayTrailingCommaCheck check = new NoArrayTrailingCommaCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheckTest.java +index c113d1500..a02fb4bd2 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoCloneCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck.MSG_KEY + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class NoCloneCheckTest extends AbstractModuleTestSupport { ++final class NoCloneCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class NoCloneCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHasClone() throws Exception { ++ void hasClone() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_KEY), + "34:5: " + getCheckMessage(MSG_KEY), +@@ -47,7 +47,7 @@ public class NoCloneCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final NoCloneCheck check = new NoCloneCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoEnumTrailingCommaCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoEnumTrailingCommaCheckTest.java +index e6e21ac6d..caa40842e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoEnumTrailingCommaCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoEnumTrailingCommaCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.NoEnumTrailingCommaC + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { ++final class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "23:12: " + getCheckMessage(MSG_KEY), + "28:12: " + getCheckMessage(MSG_KEY), +@@ -62,7 +62,7 @@ public class NoEnumTrailingCommaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final NoEnumTrailingCommaCheck check = new NoEnumTrailingCommaCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheckTest.java +index c9e308a87..80b8665b1 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/NoFinalizerCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** NoFinalizerCheck test. */ +-public class NoFinalizerCheckTest extends AbstractModuleTestSupport { ++final class NoFinalizerCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class NoFinalizerCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final NoFinalizerCheck noFinalizerCheck = new NoFinalizerCheck(); + final int[] expected = {TokenTypes.METHOD_DEF}; + +@@ -46,7 +46,7 @@ public class NoFinalizerCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHasFinalizer() throws Exception { ++ void hasFinalizer() throws Exception { + final String[] expected = { + "11:5: " + getCheckMessage(MSG_KEY), + }; +@@ -54,13 +54,13 @@ public class NoFinalizerCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHasNoFinalizer() throws Exception { ++ void hasNoFinalizer() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNoFinalizerFallThrough.java"), expected); + } + + @Test +- public void testHasNoFinalizerTryWithResource() throws Exception { ++ void hasNoFinalizerTryWithResource() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputNoFinalizerFallThrough.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheckTest.java +index e3bc16995..5e795b197 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OneStatementPerLineCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { ++final class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiCaseClass() throws Exception { ++ void multiCaseClass() throws Exception { + final String[] expected = { + "13:59: " + getCheckMessage(MSG_KEY), + "93:21: " + getCheckMessage(MSG_KEY), +@@ -49,7 +49,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final OneStatementPerLineCheck check = new OneStatementPerLineCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -63,7 +63,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithMultilineStatements() throws Exception { ++ void withMultilineStatements() throws Exception { + final String[] expected = { + "49:21: " + getCheckMessage(MSG_KEY), + "66:17: " + getCheckMessage(MSG_KEY), +@@ -79,7 +79,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void oneStatementNonCompilableInputTest() throws Exception { ++ void oneStatementNonCompilableInputTest() throws Exception { + final String[] expected = { + "39:4: " + getCheckMessage(MSG_KEY), + "44:54: " + getCheckMessage(MSG_KEY), +@@ -93,7 +93,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testResourceReferenceVariableIgnored() throws Exception { ++ void resourceReferenceVariableIgnored() throws Exception { + final String[] expected = { + "32:42: " + getCheckMessage(MSG_KEY), + "36:43: " + getCheckMessage(MSG_KEY), +@@ -106,7 +106,7 @@ public class OneStatementPerLineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testResourcesIgnored() throws Exception { ++ void resourcesIgnored() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputOneStatementPerLineTryWithResourcesIgnore.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java +index 00dd7084a..a72d178be 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/OverloadMethodsDeclarationOrderCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDecla + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTestSupport { ++final class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "32:5: " + getCheckMessage(MSG_KEY, 21), +@@ -45,7 +45,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest + } + + @Test +- public void testOverloadMethodsDeclarationOrderRecords() throws Exception { ++ void overloadMethodsDeclarationOrderRecords() throws Exception { + + final String[] expected = { + "21:9: " + getCheckMessage(MSG_KEY, 15), +@@ -57,7 +57,7 @@ public class OverloadMethodsDeclarationOrderCheckTest extends AbstractModuleTest + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final OverloadMethodsDeclarationOrderCheck check = new OverloadMethodsDeclarationOrderCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheckTest.java +index aa30995a8..ff7d5eff5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/PackageDeclarationCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import de.thetaphi.forbiddenapis.SuppressForbidden; + import org.junit.jupiter.api.Test; + +-public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { ++final class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultNoPackage() throws Exception { ++ void defaultNoPackage() throws Exception { + + final String[] expected = { + "8:1: " + getCheckMessage(MSG_KEY_MISSING), +@@ -47,7 +47,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultWithPackage() throws Exception { ++ void defaultWithPackage() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -55,7 +55,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOnFileWithCommentOnly() throws Exception { ++ void onFileWithCommentOnly() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -63,7 +63,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileForDiffDirectoryMismatch() throws Exception { ++ void fileForDiffDirectoryMismatch() throws Exception { + + final String[] expected = { + "8:1: " + getCheckMessage(MSG_KEY_MISMATCH), +@@ -74,7 +74,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileForDirectoryMismatchAtParent() throws Exception { ++ void fileForDirectoryMismatchAtParent() throws Exception { + + final String[] expected = { + "8:1: " + getCheckMessage(MSG_KEY_MISMATCH), +@@ -85,7 +85,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileForDirectoryMismatchAtSubpackage() throws Exception { ++ void fileForDirectoryMismatchAtSubpackage() throws Exception { + + final String[] expected = { + "8:1: " + getCheckMessage(MSG_KEY_MISMATCH), +@@ -96,7 +96,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileIgnoreDiffDirectoryMismatch() throws Exception { ++ void fileIgnoreDiffDirectoryMismatch() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -104,7 +104,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileIgnoreDirectoryMismatchAtParent() throws Exception { ++ void fileIgnoreDirectoryMismatchAtParent() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -112,7 +112,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileIgnoreDirectoryMismatchAtSubpackage() throws Exception { ++ void fileIgnoreDirectoryMismatchAtSubpackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -120,7 +120,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoPackage() throws Exception { ++ void noPackage() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY_MISSING), + }; +@@ -131,7 +131,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + + @SuppressForbidden + @Test +- public void testEmptyFile() throws Exception { ++ void emptyFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(PackageDeclarationCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -139,7 +139,7 @@ public class PackageDeclarationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final PackageDeclarationCheck check = new PackageDeclarationCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckTest.java +index 3e7023c27..381d1a46b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ParameterAssignmentCheckTest.java +@@ -34,7 +34,7 @@ import java.util.Optional; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { ++final class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,7 +42,7 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "17:15: " + getCheckMessage(MSG_KEY, "field"), + "18:15: " + getCheckMessage(MSG_KEY, "field"), +@@ -61,13 +61,13 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReceiverParameter() throws Exception { ++ void receiverParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParameterAssignmentReceiver.java"), expected); + } + + @Test +- public void testEnhancedSwitch() throws Exception { ++ void enhancedSwitch() throws Exception { + final String[] expected = { + "14:28: " + getCheckMessage(MSG_KEY, "a"), "21:16: " + getCheckMessage(MSG_KEY, "result"), + }; +@@ -76,7 +76,7 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final ParameterAssignmentCheck check = new ParameterAssignmentCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -95,9 +95,9 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearState() throws Exception { ++ @Test ++ void clearState() throws Exception { + final ParameterAssignmentCheck check = new ParameterAssignmentCheck(); + final Optional methodDef = + TestUtil.findTokenInAstByPredicate( +@@ -111,7 +111,7 @@ public class ParameterAssignmentCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- methodDef.get(), ++ methodDef.orElseThrow(), + "parameterNamesStack", + parameterNamesStack -> ((Collection>) parameterNamesStack).isEmpty())) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java +index dcad28f78..b09a51cf9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/RequireThisCheckTest.java +@@ -39,7 +39,7 @@ import java.util.SortedSet; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class RequireThisCheckTest extends AbstractModuleTestSupport { ++final class RequireThisCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -47,7 +47,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(MSG_VARIABLE, "i", ""), + "26:9: " + getCheckMessage(MSG_METHOD, "method1", ""), +@@ -73,7 +73,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodsOnly() throws Exception { ++ void methodsOnly() throws Exception { + final String[] expected = { + "25:9: " + getCheckMessage(MSG_METHOD, "method1", ""), + "124:9: " + getCheckMessage(MSG_METHOD, "instanceMethod", ""), +@@ -85,7 +85,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFieldsOnly() throws Exception { ++ void fieldsOnly() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_VARIABLE, "i", ""), + "39:9: " + getCheckMessage(MSG_VARIABLE, "i", ""), +@@ -107,7 +107,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFieldsInExpressions() throws Exception { ++ void fieldsInExpressions() throws Exception { + final String[] expected = { + "18:28: " + getCheckMessage(MSG_VARIABLE, "id", ""), + "19:28: " + getCheckMessage(MSG_VARIABLE, "length", ""), +@@ -133,13 +133,13 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGenerics() throws Exception { ++ void generics() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThis15Extensions.java"), expected); + } + + @Test +- public void testGithubIssue41() throws Exception { ++ void githubIssue41() throws Exception { + final String[] expected = { + "16:19: " + getCheckMessage(MSG_VARIABLE, "number", ""), + "17:16: " + getCheckMessage(MSG_METHOD, "other", ""), +@@ -148,7 +148,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final RequireThisCheck check = new RequireThisCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -162,7 +162,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithAnonymousClass() throws Exception { ++ void withAnonymousClass() throws Exception { + final String[] expected = { + "29:25: " + getCheckMessage(MSG_METHOD, "doSideEffect", ""), + "33:24: " + getCheckMessage(MSG_VARIABLE, "bar", "InputRequireThisAnonymousEmpty."), +@@ -172,7 +172,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultSwitch() { ++ void defaultSwitch() { + final RequireThisCheck check = new RequireThisCheck(); + + final DetailAstImpl ast = new DetailAstImpl(); +@@ -185,7 +185,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateOnlyOverlappingFalse() throws Exception { ++ void validateOnlyOverlappingFalse() throws Exception { + final String[] expected = { + "29:9: " + getCheckMessage(MSG_VARIABLE, "field1", ""), + "30:9: " + getCheckMessage(MSG_VARIABLE, "fieldFinal1", ""), +@@ -238,7 +238,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateOnlyOverlappingFalseLeaves() throws Exception { ++ void validateOnlyOverlappingFalseLeaves() throws Exception { + final String[] expected = { + "26:31: " + getCheckMessage(MSG_METHOD, "id", ""), + "36:16: " + getCheckMessage(MSG_VARIABLE, "_a", ""), +@@ -248,7 +248,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateOnlyOverlappingTrue() throws Exception { ++ void validateOnlyOverlappingTrue() throws Exception { + final String[] expected = { + "29:9: " + getCheckMessage(MSG_VARIABLE, "field1", ""), + "52:9: " + getCheckMessage(MSG_VARIABLE, "field1", ""), +@@ -268,32 +268,32 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidateOnlyOverlappingTrue2() throws Exception { ++ void validateOnlyOverlappingTrue2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRequireThisValidateOnlyOverlappingTrue2.java"), expected); + } + + @Test +- public void testReceiverParameter() throws Exception { ++ void receiverParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThisReceiver.java"), expected); + } + + @Test +- public void testBraceAlone() throws Exception { ++ void braceAlone() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThisBraceAlone.java"), expected); + } + + @Test +- public void testStatic() throws Exception { ++ void testStatic() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThisStatic.java"), expected); + } + + @Test +- public void testMethodReferences() throws Exception { ++ void methodReferences() throws Exception { + final String[] expected = { + "24:9: " + getCheckMessage(MSG_VARIABLE, "tags", ""), + }; +@@ -301,7 +301,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowLocalVars() throws Exception { ++ void allowLocalVars() throws Exception { + final String[] expected = { + "18:9: " + getCheckMessage(MSG_VARIABLE, "s1", ""), + "26:9: " + getCheckMessage(MSG_VARIABLE, "s1", ""), +@@ -314,7 +314,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowLambdaParameters() throws Exception { ++ void allowLambdaParameters() throws Exception { + final String[] expected = { + "24:9: " + getCheckMessage(MSG_VARIABLE, "s1", ""), + "46:21: " + getCheckMessage(MSG_VARIABLE, "z", ""), +@@ -326,13 +326,13 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResources() throws Exception { ++ void tryWithResources() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThisTryWithResources.java"), expected); + } + + @Test +- public void testTryWithResourcesOnlyOverlappingFalse() throws Exception { ++ void tryWithResourcesOnlyOverlappingFalse() throws Exception { + final String[] expected = { + "44:23: " + getCheckMessage(MSG_VARIABLE, "fldCharset", ""), + "57:13: " + getCheckMessage(MSG_VARIABLE, "fldCharset", ""), +@@ -350,7 +350,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCatchVariables() throws Exception { ++ void catchVariables() throws Exception { + final String[] expected = { + "38:21: " + getCheckMessage(MSG_VARIABLE, "ex", ""), + }; +@@ -358,19 +358,19 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumConstant() throws Exception { ++ void enumConstant() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThisEnumConstant.java"), expected); + } + + @Test +- public void testAnnotationInterface() throws Exception { ++ void annotationInterface() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThisAnnotationInterface.java"), expected); + } + + @Test +- public void testFor() throws Exception { ++ void testFor() throws Exception { + final String[] expected = { + "22:13: " + getCheckMessage(MSG_VARIABLE, "bottom", ""), + "30:34: " + getCheckMessage(MSG_VARIABLE, "name", ""), +@@ -379,7 +379,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalInstanceVariable() throws Exception { ++ void finalInstanceVariable() throws Exception { + final String[] expected = { + "18:9: " + getCheckMessage(MSG_VARIABLE, "y", ""), + "19:9: " + getCheckMessage(MSG_VARIABLE, "z", ""), +@@ -388,13 +388,13 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRequireThisCaseGroup.java"), expected); + } + + @Test +- public void testExtendedMethod() throws Exception { ++ void extendedMethod() throws Exception { + final String[] expected = { + "31:9: " + getCheckMessage(MSG_VARIABLE, "EXPR", ""), + }; +@@ -402,7 +402,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsAndCompactCtors() throws Exception { ++ void recordsAndCompactCtors() throws Exception { + final String[] expected = { + "18:13: " + getCheckMessage(MSG_METHOD, "method1", ""), + "19:13: " + getCheckMessage(MSG_METHOD, "method2", ""), +@@ -418,14 +418,14 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordCompactCtors() throws Exception { ++ void recordCompactCtors() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputRequireThisRecordCompactCtors.java"), expected); + } + + @Test +- public void testRecordsAsTopLevel() throws Exception { ++ void recordsAsTopLevel() throws Exception { + final String[] expected = { + "17:9: " + getCheckMessage(MSG_METHOD, "method1", ""), + "18:9: " + getCheckMessage(MSG_METHOD, "method2", ""), +@@ -440,7 +440,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsDefault() throws Exception { ++ void recordsDefault() throws Exception { + final String[] expected = { + "26:9: " + getCheckMessage(MSG_VARIABLE, "x", ""), + }; +@@ -449,14 +449,14 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsWithCheckFields() throws Exception { ++ void recordsWithCheckFields() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputRequireThisRecordsWithCheckFields.java"), expected); + } + + @Test +- public void testRecordsWithCheckFieldsOverlap() throws Exception { ++ void recordsWithCheckFieldsOverlap() throws Exception { + final String[] expected = { + "20:20: " + getCheckMessage(MSG_VARIABLE, "a", ""), + "39:20: " + getCheckMessage(MSG_VARIABLE, "a", ""), +@@ -467,7 +467,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLocalClassesInsideLambdas() throws Exception { ++ void localClassesInsideLambdas() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRequireThisLocalClassesInsideLambdas.java"), expected); +@@ -480,7 +480,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws an exception. + */ + @Test +- public void testUnusedMethodCatch() throws Exception { ++ void unusedMethodCatch() throws Exception { + final DetailAstImpl ident = new DetailAstImpl(); + ident.setText("testName"); + +@@ -503,7 +503,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws an exception. + */ + @Test +- public void testUnusedMethodFor() throws Exception { ++ void unusedMethodFor() throws Exception { + final DetailAstImpl ident = new DetailAstImpl(); + ident.setText("testName"); + +@@ -524,7 +524,7 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final RequireThisCheck check = new RequireThisCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -536,7 +536,10 @@ public class RequireThisCheckTest extends AbstractModuleTestSupport { + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +- check, classDef.get(), "current", current -> ((Collection) current).isEmpty())) ++ check, ++ classDef.orElseThrow(), ++ "current", ++ current -> ((Collection) current).isEmpty())) + .isTrue(); + } + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckTest.java +index 0370ac8a1..2da7af6a3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/ReturnCountCheckTest.java +@@ -36,7 +36,7 @@ import java.util.Optional; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class ReturnCountCheckTest extends AbstractModuleTestSupport { ++final class ReturnCountCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -44,7 +44,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "28:5: " + getCheckMessage(MSG_KEY_VOID, 7, 1), + "40:5: " + getCheckMessage(MSG_KEY_VOID, 2, 1), +@@ -55,7 +55,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFormat() throws Exception { ++ void format() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_KEY, 7, 2), + "28:5: " + getCheckMessage(MSG_KEY_VOID, 7, 1), +@@ -67,7 +67,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodsAndLambdas() throws Exception { ++ void methodsAndLambdas() throws Exception { + final String[] expected = { + "25:55: " + getCheckMessage(MSG_KEY, 2, 1), + "37:49: " + getCheckMessage(MSG_KEY, 2, 1), +@@ -79,7 +79,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdasOnly() throws Exception { ++ void lambdasOnly() throws Exception { + final String[] expected = { + "43:42: " + getCheckMessage(MSG_KEY, 3, 2), + }; +@@ -87,7 +87,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodsOnly() throws Exception { ++ void methodsOnly() throws Exception { + final String[] expected = { + "35:5: " + getCheckMessage(MSG_KEY, 3, 2), + "42:5: " + getCheckMessage(MSG_KEY, 4, 2), +@@ -98,13 +98,13 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithReturnOnlyAsTokens() throws Exception { ++ void withReturnOnlyAsTokens() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputReturnCountLambda4.java"), expected); + } + + @Test +- public void testImproperToken() { ++ void improperToken() { + final ReturnCountCheck check = new ReturnCountCheck(); + + final DetailAstImpl classDefAst = new DetailAstImpl(); +@@ -126,7 +126,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMaxForVoid() throws Exception { ++ void maxForVoid() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY_VOID, 1, 0), + "18:5: " + getCheckMessage(MSG_KEY_VOID, 1, 0), +@@ -143,9 +143,9 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearState() throws Exception { ++ @Test ++ void clearState() throws Exception { + final ReturnCountCheck check = new ReturnCountCheck(); + final Optional methodDef = + TestUtil.findTokenInAstByPredicate( +@@ -159,7 +159,7 @@ public class ReturnCountCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- methodDef.get(), ++ methodDef.orElseThrow(), + "contextStack", + contextStack -> ((Collection>) contextStack).isEmpty())) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheckTest.java +index 51ed906c6..ea310ab23 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanExpressionCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpre + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSupport { ++final class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSuppor + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "22:18: " + getCheckMessage(MSG_KEY), + "43:36: " + getCheckMessage(MSG_KEY), +@@ -53,7 +53,7 @@ public class SimplifyBooleanExpressionCheckTest extends AbstractModuleTestSuppor + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final SimplifyBooleanExpressionCheck check = new SimplifyBooleanExpressionCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheckTest.java +index 4dfc9e58a..85ce8f9a3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SimplifyBooleanReturnCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanRetur + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { ++final class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "22:9: " + getCheckMessage(MSG_KEY), "35:9: " + getCheckMessage(MSG_KEY), + }; +@@ -41,7 +41,7 @@ public class SimplifyBooleanReturnCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final SimplifyBooleanReturnCheck check = new SimplifyBooleanReturnCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheckTest.java +index 70f308a23..03816703d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualit + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { ++final class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "17:18: " + getCheckMessage(MSG_KEY, "=="), + "22:20: " + getCheckMessage(MSG_KEY, "=="), +@@ -43,7 +43,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStringLiteralEqualityTextBlocks() throws Exception { ++ void stringLiteralEqualityTextBlocks() throws Exception { + final String[] expected = { + "14:34: " + getCheckMessage(MSG_KEY, "=="), + "22:21: " + getCheckMessage(MSG_KEY, "=="), +@@ -55,7 +55,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testConcatenatedStringLiterals() throws Exception { ++ void concatenatedStringLiterals() throws Exception { + final String[] expected = { + "14:15: " + getCheckMessage(MSG_KEY, "=="), + "17:24: " + getCheckMessage(MSG_KEY, "=="), +@@ -74,7 +74,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testConcatenatedTextBlocks() throws Exception { ++ void concatenatedTextBlocks() throws Exception { + final String[] expected = { + "15:15: " + getCheckMessage(MSG_KEY, "=="), + "21:23: " + getCheckMessage(MSG_KEY, "=="), +@@ -91,7 +91,7 @@ public class StringLiteralEqualityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final StringLiteralEqualityCheck check = new StringLiteralEqualityCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheckTest.java +index 719e5cd6c..0315f0ec8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperCloneCheckTest.java +@@ -34,7 +34,7 @@ import java.util.Optional; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class SuperCloneCheckTest extends AbstractModuleTestSupport { ++final class SuperCloneCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,7 +42,7 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "33:19: " + getCheckMessage(MSG_KEY, "clone", "super.clone"), + "41:19: " + getCheckMessage(MSG_KEY, "clone", "super.clone"), +@@ -52,7 +52,7 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnotherInputFile() throws Exception { ++ void anotherInputFile() throws Exception { + final String[] expected = { + "14:17: " + getCheckMessage(MSG_KEY, "clone", "super.clone"), + "48:17: " + getCheckMessage(MSG_KEY, "clone", "super.clone"), +@@ -61,13 +61,13 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodReference() throws Exception { ++ void methodReference() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputSuperCloneMethodReference.java"), expected); + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final SuperCloneCheck check = new SuperCloneCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -86,9 +86,9 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearState() throws Exception { ++ @Test ++ void clearState() throws Exception { + final AbstractSuperCheck check = new SuperCloneCheck(); + final Optional methodDef = + TestUtil.findTokenInAstByPredicate( +@@ -102,7 +102,7 @@ public class SuperCloneCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- methodDef.get(), ++ methodDef.orElseThrow(), + "methodStack", + methodStack -> ((Collection>) methodStack).isEmpty())) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckTest.java +index 1f42bf3d6..e894e6b71 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/SuperFinalizeCheckTest.java +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck.M + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class SuperFinalizeCheckTest extends AbstractModuleTestSupport { ++final class SuperFinalizeCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class SuperFinalizeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "34:17: " + getCheckMessage(MSG_KEY, "finalize", "super.finalize"), + "41:17: " + getCheckMessage(MSG_KEY, "finalize", "super.finalize"), +@@ -42,7 +42,7 @@ public class SuperFinalizeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodReference() throws Exception { ++ void methodReference() throws Exception { + final String[] expected = { + "23:20: " + getCheckMessage(MSG_KEY, "finalize", "super.finalize"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckTest.java +index bd94c3eb0..f68060c1e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessaryParenthesesCheckTest.java +@@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Test fixture for the UnnecessaryParenthesesCheck. */ +-public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { ++final class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,7 +41,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "18:22: " + getCheckMessage(MSG_ASSIGN), +@@ -97,7 +97,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test15Extensions() throws Exception { ++ void test15Extensions() throws Exception { + final String[] expected = { + "28:23: " + getCheckMessage(MSG_EXPR), + "28:51: " + getCheckMessage(MSG_LITERAL, "1"), +@@ -107,7 +107,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdas() throws Exception { ++ void lambdas() throws Exception { + final String[] expected = { + "17:35: " + getCheckMessage(MSG_LAMBDA), + "18:35: " + getCheckMessage(MSG_LAMBDA), +@@ -122,7 +122,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReturn() throws Exception { ++ void testReturn() throws Exception { + final String[] expected = { + "21:33: " + getCheckMessage(MSG_RETURN), + "22:16: " + getCheckMessage(MSG_RETURN), +@@ -135,7 +135,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnecessaryParenthesesSwitchExpression() throws Exception { ++ void unnecessaryParenthesesSwitchExpression() throws Exception { + final String[] expected = { + "21:31: " + getCheckMessage(MSG_ASSIGN), + "24:13: " + getCheckMessage(MSG_LITERAL, 2), +@@ -154,7 +154,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnecessaryParenthesesTextBlocks() throws Exception { ++ void unnecessaryParenthesesTextBlocks() throws Exception { + final String[] expected = { + "19:23: " + getCheckMessage(MSG_STRING, "\"this\""), + "19:34: " + getCheckMessage(MSG_STRING, "\"that\""), +@@ -170,14 +170,14 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnecessaryParenthesesPatterns() throws Exception { ++ void unnecessaryParenthesesPatterns() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputUnnecessaryParenthesesCheckPatterns.java"), expected); + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final UnnecessaryParenthesesCheck check = new UnnecessaryParenthesesCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -191,7 +191,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIfStatement() throws Exception { ++ void ifStatement() throws Exception { + + final String[] expected = { + "20:20: " + getCheckMessage(MSG_EXPR), +@@ -225,7 +225,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIfStatement2() throws Exception { ++ void ifStatement2() throws Exception { + final String[] expected = { + "28:17: " + getCheckMessage(MSG_EXPR), + "39:17: " + getCheckMessage(MSG_EXPR), +@@ -241,7 +241,7 @@ public class UnnecessaryParenthesesCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIdentifier() throws Exception { ++ void identifier() throws Exception { + final String[] expected = { + "22:17: " + getCheckMessage(MSG_IDENT, "test"), + "31:18: " + getCheckMessage(MSG_ASSIGN), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest.java +index a378a5212..a1a02238e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest ++final class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest + extends AbstractModuleTestSupport { + + @Override +@@ -37,7 +37,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "28:2: " + getCheckMessage(MSG_SEMI), +@@ -51,7 +51,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest + } + + @Test +- public void testUnnecessarySemicolonAfterOuterTypeDeclarationRecords() throws Exception { ++ void unnecessarySemicolonAfterOuterTypeDeclarationRecords() throws Exception { + + final String[] expected = { + "17:2: " + getCheckMessage(MSG_SEMI), "23:2: " + getCheckMessage(MSG_SEMI), +@@ -63,7 +63,7 @@ public class UnnecessarySemicolonAfterOuterTypeDeclarationCheckTest + } + + @Test +- public void testTokens() { ++ void tokens() { + final UnnecessarySemicolonAfterOuterTypeDeclarationCheck check = + new UnnecessarySemicolonAfterOuterTypeDeclarationCheck(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest.java +index 30c641cba..04c3250dc 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest ++final class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest + extends AbstractModuleTestSupport { + + @Override +@@ -37,7 +37,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "13:5: " + getCheckMessage(MSG_SEMI), +@@ -61,7 +61,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest + } + + @Test +- public void testUnnecessarySemicolonAfterTypeMemberDeclarationRecords() throws Exception { ++ void unnecessarySemicolonAfterTypeMemberDeclarationRecords() throws Exception { + + final String[] expected = { + "14:5: " + getCheckMessage(MSG_SEMI), +@@ -79,7 +79,7 @@ public class UnnecessarySemicolonAfterTypeMemberDeclarationCheckTest + } + + @Test +- public void testTokens() { ++ void tokens() { + final UnnecessarySemicolonAfterTypeMemberDeclarationCheck check = + new UnnecessarySemicolonAfterTypeMemberDeclarationCheck(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckTest.java +index f09e99c57..08614e98f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInEnumerationCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + + /** Test fixture for the UnnecessarySemicolonInEnumerationCheck. */ +-public class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTestSupport { ++final class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTe + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "30:12: " + getCheckMessage(MSG_SEMI), +@@ -55,7 +55,7 @@ public class UnnecessarySemicolonInEnumerationCheckTest extends AbstractModuleTe + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final UnnecessarySemicolonInEnumerationCheck check = + new UnnecessarySemicolonInEnumerationCheck(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInTryWithResourcesCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInTryWithResourcesCheckTest.java +index c55e232a8..4eba66e40 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInTryWithResourcesCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnnecessarySemicolonInTryWithResourcesCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractModuleTestSupport { ++final class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractMod + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "17:42: " + getCheckMessage(MSG_SEMI), "18:72: " + getCheckMessage(MSG_SEMI), +@@ -46,7 +46,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractMod + } + + @Test +- public void testNoBraceAfterAllowed() throws Exception { ++ void noBraceAfterAllowed() throws Exception { + final String[] expected = { + "16:42: " + getCheckMessage(MSG_SEMI), + "19:13: " + getCheckMessage(MSG_SEMI), +@@ -58,7 +58,7 @@ public class UnnecessarySemicolonInTryWithResourcesCheckTest extends AbstractMod + } + + @Test +- public void testTokensAreCorrect() { ++ void tokensAreCorrect() { + final UnnecessarySemicolonInTryWithResourcesCheck check = + new UnnecessarySemicolonInTryWithResourcesCheck(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckTest.java +index ef21aaab8..09a184c40 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/UnusedLocalVariableCheckTest.java +@@ -36,7 +36,7 @@ import java.util.Optional; + import java.util.function.Predicate; + import org.junit.jupiter.api.Test; + +-public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { ++final class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -44,7 +44,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final UnusedLocalVariableCheck checkObj = new UnusedLocalVariableCheck(); + final int[] actual = checkObj.getRequiredTokens(); + final int[] expected = { +@@ -73,7 +73,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final UnusedLocalVariableCheck typeParameterNameCheckObj = new UnusedLocalVariableCheck(); + final int[] actual = typeParameterNameCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -102,7 +102,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVariable() throws Exception { ++ void unusedLocalVariable() throws Exception { + final String[] expected = { + "27:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "sameName"), + "28:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "b"), +@@ -122,7 +122,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVar2() throws Exception { ++ void unusedLocalVar2() throws Exception { + final String[] expected = { + "17:14: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "i"), + "19:14: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "j"), +@@ -138,7 +138,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarInAnonInnerClasses() throws Exception { ++ void unusedLocalVarInAnonInnerClasses() throws Exception { + final String[] expected = { + "14:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "15:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "b"), +@@ -155,7 +155,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarGenericAnonInnerClasses() throws Exception { ++ void unusedLocalVarGenericAnonInnerClasses() throws Exception { + final String[] expected = { + "13:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "l"), + "14:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "obj"), +@@ -171,7 +171,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarDepthOfClasses() throws Exception { ++ void unusedLocalVarDepthOfClasses() throws Exception { + final String[] expected = { + "28:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "r"), + "49:21: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), +@@ -182,7 +182,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarNestedClasses() throws Exception { ++ void unusedLocalVarNestedClasses() throws Exception { + final String[] expected = { + "21:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "V"), + "23:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "S"), +@@ -196,7 +196,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarNestedClasses2() throws Exception { ++ void unusedLocalVarNestedClasses2() throws Exception { + final String[] expected = { + "29:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "q"), + "30:51: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "obj"), +@@ -208,7 +208,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarNestedClasses3() throws Exception { ++ void unusedLocalVarNestedClasses3() throws Exception { + final String[] expected = { + "36:17: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "p2"), + "54:13: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "o"), +@@ -220,7 +220,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarEnum() throws Exception { ++ void unusedLocalVarEnum() throws Exception { + final String[] expected = { + "22:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "50:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), +@@ -232,7 +232,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarRecords() throws Exception { ++ void unusedLocalVarRecords() throws Exception { + final String[] expected = { + "16:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var1"), + "25:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var1"), +@@ -244,7 +244,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVarWithoutPackageStatement() throws Exception { ++ void unusedLocalVarWithoutPackageStatement() throws Exception { + final String[] expected = { + "12:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "a"), + "24:9: " + getCheckMessage(MSG_UNUSED_LOCAL_VARIABLE, "var2"), +@@ -255,14 +255,14 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnusedLocalVariableTernaryAndExpressions() throws Exception { ++ void unusedLocalVariableTernaryAndExpressions() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputUnusedLocalVariableTernaryAndExpressions.java"), expected); + } + + @Test +- public void testClearStateVariables() throws Exception { ++ void clearStateVariables() throws Exception { + final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); + final Optional methodDef = + TestUtil.findTokenInAstByPredicate( +@@ -272,7 +272,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + ast -> ast.getType() == TokenTypes.METHOD_DEF); + assertWithMessage("Ast should contain METHOD_DEF").that(methodDef.isPresent()).isTrue(); + final DetailAST variableDef = +- methodDef.get().getLastChild().findFirstToken(TokenTypes.VARIABLE_DEF); ++ methodDef.orElseThrow().getLastChild().findFirstToken(TokenTypes.VARIABLE_DEF); + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +@@ -286,7 +286,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearStateClasses() throws Exception { ++ void clearStateClasses() throws Exception { + final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); + final Optional classDef = + TestUtil.findTokenInAstByPredicate( +@@ -295,7 +295,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + JavaParser.Options.WITHOUT_COMMENTS), + ast -> ast.getType() == TokenTypes.CLASS_DEF); + assertWithMessage("Ast should contain CLASS_DEF").that(classDef.isPresent()).isTrue(); +- final DetailAST classDefToken = classDef.get(); ++ final DetailAST classDefToken = classDef.orElseThrow(); + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +@@ -329,7 +329,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearStateAnonInnerClass() throws Exception { ++ void clearStateAnonInnerClass() throws Exception { + final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -343,7 +343,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + assertWithMessage("Ast should contain LITERAL_NEW").that(literalNew.isPresent()).isTrue(); + check.beginTree(root); + check.visitToken(classDefAst); +- check.visitToken(literalNew.get()); ++ check.visitToken(literalNew.orElseThrow()); + check.beginTree(null); + final Predicate isClear = + anonInnerAstToTypeDesc -> { +@@ -362,7 +362,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearStatePackageDef() throws Exception { ++ void clearStatePackageDef() throws Exception { + final UnusedLocalVariableCheck check = new UnusedLocalVariableCheck(); + final Optional packageDef = + TestUtil.findTokenInAstByPredicate( +@@ -371,7 +371,7 @@ public class UnusedLocalVariableCheckTest extends AbstractModuleTestSupport { + JavaParser.Options.WITHOUT_COMMENTS), + ast -> ast.getType() == TokenTypes.PACKAGE_DEF); + assertWithMessage("Ast should contain PACKAGE_DEF").that(packageDef.isPresent()).isTrue(); +- final DetailAST packageDefToken = packageDef.get(); ++ final DetailAST packageDefToken = packageDef.orElseThrow(); + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckTest.java +index 1589a812f..383581372 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTestSupport { ++final class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testGeneralLogic() throws Exception { ++ void generalLogic() throws Exception { + final String[] expected = { + "42:9: " + getCheckMessage(MSG_KEY, "a", 2, 1), + "50:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), +@@ -79,7 +79,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testGeneralLogic2() throws Exception { ++ void generalLogic2() throws Exception { + final String[] expected = { + "17:9: " + getCheckMessage(MSG_KEY, "first", 5, 1), + "29:9: " + getCheckMessage(MSG_KEY, "allInvariants", 2, 1), +@@ -90,7 +90,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testIfStatements() throws Exception { ++ void ifStatements() throws Exception { + final String[] expected = { + "18:9: " + getCheckMessage(MSG_KEY, "a", 4, 1), + "28:9: " + getCheckMessage(MSG_KEY, "a", 2, 1), +@@ -106,7 +106,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testDistance() throws Exception { ++ void distance() throws Exception { + final String[] expected = { + "83:9: " + getCheckMessage(MSG_KEY, "count", 4, 3), + "231:9: " + getCheckMessage(MSG_KEY, "t", 5, 3), +@@ -122,7 +122,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testVariableRegExp() throws Exception { ++ void variableRegExp() throws Exception { + final String[] expected = { + "50:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), + "56:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), +@@ -155,7 +155,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testValidateBetweenScopesOption() throws Exception { ++ void validateBetweenScopesOption() throws Exception { + final String[] expected = { + "42:9: " + getCheckMessage(MSG_KEY, "a", 2, 1), + "50:9: " + getCheckMessage(MSG_KEY, "temp", 2, 1), +@@ -187,7 +187,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testIgnoreFinalOption() throws Exception { ++ void ignoreFinalOption() throws Exception { + final String[] expected = { + "42:9: " + getCheckMessage(MSG_KEY_EXT, "a", 2, 1), + "50:9: " + getCheckMessage(MSG_KEY_EXT, "temp", 2, 1), +@@ -229,7 +229,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testTokensNotNull() { ++ void tokensNotNull() { + final VariableDeclarationUsageDistanceCheck check = new VariableDeclarationUsageDistanceCheck(); + assertWithMessage("Acceptable tokens should not be null") + .that(check.getAcceptableTokens()) +@@ -243,7 +243,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = { + "83:9: " + getCheckMessage(MSG_KEY_EXT, "count", 4, 3), + "231:9: " + getCheckMessage(MSG_KEY_EXT, "t", 5, 3), +@@ -259,7 +259,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testDefaultConfiguration2() throws Exception { ++ void defaultConfiguration2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -267,7 +267,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testAnonymousClass() throws Exception { ++ void anonymousClass() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_KEY_EXT, "prefs", 4, 3), + }; +@@ -277,7 +277,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testLabels() throws Exception { ++ void labels() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -285,7 +285,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testVariableDeclarationUsageDistanceSwitchExpressions() throws Exception { ++ void variableDeclarationUsageDistanceSwitchExpressions() throws Exception { + + final int maxDistance = 1; + final String[] expected = { +@@ -304,7 +304,7 @@ public class VariableDeclarationUsageDistanceCheckTest extends AbstractModuleTes + } + + @Test +- public void testVariableDeclarationUsageDistanceSwitchExpressions2() throws Exception { ++ void variableDeclarationUsageDistanceSwitchExpressions2() throws Exception { + final int maxDistance = 1; + final String[] expected = { + "16:9: " + getCheckMessage(MSG_KEY, "i", 2, maxDistance), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckTest.java +index 839991f47..900d5c6de 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/DesignForExtensionCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { ++final class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final DesignForExtensionCheck checkObj = new DesignForExtensionCheck(); + final int[] expected = {TokenTypes.METHOD_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -44,7 +44,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "50:5: " + getCheckMessage(MSG_KEY, "InputDesignForExtension", "doh"), + "104:9: " + getCheckMessage(MSG_KEY, "anotherNonFinalClass", "someMethod"), +@@ -53,7 +53,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final DesignForExtensionCheck obj = new DesignForExtensionCheck(); + final int[] expected = {TokenTypes.METHOD_DEF}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -62,7 +62,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOverridableMethods() throws Exception { ++ void overridableMethods() throws Exception { + final String[] expected = { + "14:9: " + getCheckMessage(MSG_KEY, "A", "foo1"), + "38:9: " + getCheckMessage(MSG_KEY, "A", "foo8"), +@@ -89,7 +89,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoredAnnotationsOption() throws Exception { ++ void ignoredAnnotationsOption() throws Exception { + final String[] expected = { + "39:5: " + getCheckMessage(MSG_KEY, "InputDesignForExtensionIgnoredAnnotations", "foo1"), + "149:5: " + getCheckMessage(MSG_KEY, "InputDesignForExtensionIgnoredAnnotations", "foo21"), +@@ -102,14 +102,14 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreAnnotationsOptionWithMultipleAnnotations() throws Exception { ++ void ignoreAnnotationsOptionWithMultipleAnnotations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputDesignForExtensionMultipleAnnotations.java"), expected); + } + + @Test +- public void testNativeMethods() throws Exception { ++ void nativeMethods() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY, "InputDesignForExtensionNativeMethods", "foo1"), + "32:5: " + getCheckMessage(MSG_KEY, "InputDesignForExtensionNativeMethods", "foo6"), +@@ -118,7 +118,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDesignForExtensionRecords() throws Exception { ++ void designForExtensionRecords() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -127,7 +127,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredJavadocPhrase() throws Exception { ++ void requiredJavadocPhrase() throws Exception { + final String className = "InputDesignForExtensionRequiredJavadocPhrase"; + final String[] expected = { + "41:5: " + getCheckMessage(MSG_KEY, className, "foo5"), +@@ -140,7 +140,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredJavadocPhraseMultiLine() throws Exception { ++ void requiredJavadocPhraseMultiLine() throws Exception { + final String className = "InputDesignForExtensionRequiredJavadocPhraseMultiLine"; + final String[] expected = { + "23:5: " + getCheckMessage(MSG_KEY, className, "foo2"), +@@ -150,7 +150,7 @@ public class DesignForExtensionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceMemberScopeIsPublic() throws Exception { ++ void interfaceMemberScopeIsPublic() throws Exception { + final String[] expected = { + "15:9: " + getCheckMessage(MSG_KEY, "Inner", "getProperty"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheckTest.java +index 8a324d0ff..22e18f06e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/FinalClassCheckTest.java +@@ -32,7 +32,7 @@ import java.io.File; + import java.util.Optional; + import org.junit.jupiter.api.Test; + +-public class FinalClassCheckTest extends AbstractModuleTestSupport { ++final class FinalClassCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final FinalClassCheck checkObj = new FinalClassCheck(); + final int[] expected = { + TokenTypes.ANNOTATION_DEF, +@@ -58,7 +58,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClass() throws Exception { ++ void finalClass() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_KEY, "InputFinalClass"), + "19:4: " + getCheckMessage(MSG_KEY, "test4"), +@@ -72,7 +72,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassWithPrivateCtorAndNestedExtendingSubclass() throws Exception { ++ void classWithPrivateCtorAndNestedExtendingSubclass() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_KEY, "C"), + }; +@@ -82,7 +82,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassWithPrivateCtorAndNestedExtendingSubclassWithoutPackage() throws Exception { ++ void classWithPrivateCtorAndNestedExtendingSubclassWithoutPackage() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, "C"), + }; +@@ -93,7 +93,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassConstructorInRecord() throws Exception { ++ void finalClassConstructorInRecord() throws Exception { + + final String[] expected = { + "27:9: " + getCheckMessage(MSG_KEY, "F"), +@@ -104,7 +104,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImproperToken() { ++ void improperToken() { + final FinalClassCheck finalClassCheck = new FinalClassCheck(); + final DetailAstImpl badAst = new DetailAstImpl(); + final int unsupportedTokenByCheck = TokenTypes.COMPILATION_UNIT; +@@ -120,7 +120,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final FinalClassCheck obj = new FinalClassCheck(); + final int[] expected = { + TokenTypes.ANNOTATION_DEF, +@@ -138,7 +138,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassInnerAndNestedClasses() throws Exception { ++ void finalClassInnerAndNestedClasses() throws Exception { + final String[] expected = { + "19:5: " + getCheckMessage(MSG_KEY, "SameName"), + "45:9: " + getCheckMessage(MSG_KEY, "SameName"), +@@ -149,7 +149,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassStaticNestedClasses() throws Exception { ++ void finalClassStaticNestedClasses() throws Exception { + + final String[] expected = { + "14:17: " + getCheckMessage(MSG_KEY, "C"), +@@ -165,7 +165,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassEnum() throws Exception { ++ void finalClassEnum() throws Exception { + final String[] expected = { + "35:5: " + getCheckMessage(MSG_KEY, "DerivedClass"), + }; +@@ -173,7 +173,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassAnnotation() throws Exception { ++ void finalClassAnnotation() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_KEY, "DerivedClass"), + }; +@@ -181,7 +181,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassInterface() throws Exception { ++ void finalClassInterface() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_KEY, "DerivedClass"), + }; +@@ -189,7 +189,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassAnonymousInnerClass() throws Exception { ++ void finalClassAnonymousInnerClass() throws Exception { + final String[] expected = { + "11:9: " + getCheckMessage(MSG_KEY, "b"), + "27:9: " + getCheckMessage(MSG_KEY, "m"), +@@ -204,7 +204,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassNestedInInterface() throws Exception { ++ void finalClassNestedInInterface() throws Exception { + final String[] expected = { + "24:5: " + getCheckMessage(MSG_KEY, "b"), + "28:13: " + getCheckMessage(MSG_KEY, "m"), +@@ -215,7 +215,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassNestedInEnum() throws Exception { ++ void finalClassNestedInEnum() throws Exception { + final String[] expected = { + "13:9: " + getCheckMessage(MSG_KEY, "j"), "27:9: " + getCheckMessage(MSG_KEY, "n"), + }; +@@ -224,7 +224,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalClassNestedInRecord() throws Exception { ++ void finalClassNestedInRecord() throws Exception { + final String[] expected = { + "13:9: " + getCheckMessage(MSG_KEY, "c"), "31:13: " + getCheckMessage(MSG_KEY, "j"), + }; +@@ -239,7 +239,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final FinalClassCheck check = new FinalClassCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -252,7 +252,7 @@ public class FinalClassCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- packageDef.get(), ++ packageDef.orElseThrow(), + "packageName", + packageName -> ((String) packageName).isEmpty())) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheckTest.java +index 6467a9c4a..614a05ed5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/HideUtilityClassConstructorCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupport { ++final class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final HideUtilityClassConstructorCheck checkObj = new HideUtilityClassConstructorCheck(); + final int[] expected = {TokenTypes.CLASS_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -44,7 +44,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testUtilClass() throws Exception { ++ void utilClass() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), + }; +@@ -53,7 +53,7 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testUtilClassPublicCtor() throws Exception { ++ void utilClassPublicCtor() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY), + }; +@@ -61,69 +61,69 @@ public class HideUtilityClassConstructorCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testUtilClassPrivateCtor() throws Exception { ++ void utilClassPrivateCtor() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputHideUtilityClassConstructorPrivate.java"), expected); + } + + /** Non-static methods - always OK. */ + @Test +- public void testNonUtilClass() throws Exception { ++ void nonUtilClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputHideUtilityClassConstructorDesignForExtension.java"), expected); + } + + @Test +- public void testDerivedNonUtilClass() throws Exception { ++ void derivedNonUtilClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputHideUtilityClassConstructorNonUtilityClass.java"), expected); + } + + @Test +- public void testOnlyNonStaticFieldNonUtilClass() throws Exception { ++ void onlyNonStaticFieldNonUtilClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputHideUtilityClassConstructorRegression.java"), expected); + } + + @Test +- public void testEmptyAbstractClass() throws Exception { ++ void emptyAbstractClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputHideUtilityClassConstructorAbstractSerializable.java"), expected); + } + + @Test +- public void testEmptyAbstractClass2() throws Exception { ++ void emptyAbstractClass2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputHideUtilityClassConstructorAbstract.java"), expected); + } + + @Test +- public void testEmptyClassWithOnlyPrivateFields() throws Exception { ++ void emptyClassWithOnlyPrivateFields() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputHideUtilityClassConstructorSerializable.java"), expected); + } + + @Test +- public void testClassWithStaticInnerClass() throws Exception { ++ void classWithStaticInnerClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputHideUtilityClassConstructorSerializableInnerStatic.java"), expected); + } + + @Test +- public void testProtectedCtor() throws Exception { ++ void protectedCtor() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputHideUtilityClassConstructor.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final HideUtilityClassConstructorCheck obj = new HideUtilityClassConstructorCheck(); + final int[] expected = {TokenTypes.CLASS_DEF}; + assertWithMessage("Default acceptable tokens are invalid") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckTest.java +index f29b07e21..08261de66 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InnerTypeLastCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import org.junit.jupiter.api.Test; + +-public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { ++final class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final InnerTypeLastCheck checkObj = new InnerTypeLastCheck(); + final int[] expected = { + TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.RECORD_DEF, +@@ -48,7 +48,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMembersBeforeInner() throws Exception { ++ void membersBeforeInner() throws Exception { + final String[] expected = { + "50:9: " + getCheckMessage(MSG_KEY), + "71:9: " + getCheckMessage(MSG_KEY), +@@ -60,19 +60,19 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIfRootClassChecked() throws Exception { ++ void ifRootClassChecked() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputInnerTypeLastClassRootClass.java"), expected); + } + + @Test +- public void testIfRootClassChecked2() throws Exception { ++ void ifRootClassChecked2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputInnerTypeLastClassRootClass2.java"), expected); + } + + @Test +- public void testIfRootClassChecked3() throws Exception { ++ void ifRootClassChecked3() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(InnerTypeLastCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify( +@@ -86,7 +86,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerTypeBeforeCtor() throws Exception { ++ void innerTypeBeforeCtor() throws Exception { + final String[] expected = { + "13:5: " + getCheckMessage(MSG_KEY), + "22:5: " + getCheckMessage(MSG_KEY), +@@ -96,7 +96,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerTypeLastRecords() throws Exception { ++ void innerTypeLastRecords() throws Exception { + + final String[] expected = { + "17:9: " + getCheckMessage(MSG_KEY), +@@ -111,7 +111,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerTypeLastCstyleArray() throws Exception { ++ void innerTypeLastCstyleArray() throws Exception { + final String[] expected = { + "11:5: " + getCheckMessage(MSG_KEY), + "12:5: " + getCheckMessage(MSG_KEY), +@@ -122,7 +122,7 @@ public class InnerTypeLastCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final InnerTypeLastCheck obj = new InnerTypeLastCheck(); + final int[] expected = { + TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.RECORD_DEF, +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheckTest.java +index 9b6b40a7c..0117499cb 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/InterfaceIsTypeCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { ++final class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "28:5: " + getCheckMessage(MSG_KEY), + }; +@@ -42,7 +42,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowMarker() throws Exception { ++ void allowMarker() throws Exception { + final String[] expected = { + "23:5: " + getCheckMessage(MSG_KEY), "28:5: " + getCheckMessage(MSG_KEY), + }; +@@ -50,7 +50,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final InterfaceIsTypeCheck obj = new InterfaceIsTypeCheck(); + final int[] expected = {TokenTypes.INTERFACE_DEF}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -59,7 +59,7 @@ public class InterfaceIsTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final InterfaceIsTypeCheck obj = new InterfaceIsTypeCheck(); + final int[] expected = {TokenTypes.INTERFACE_DEF}; + assertWithMessage("Default required tokens are invalid") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheckTest.java +index b7f7b4cb0..35b6fb599 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/MutableExceptionCheckTest.java +@@ -34,7 +34,7 @@ import java.util.List; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class MutableExceptionCheckTest extends AbstractModuleTestSupport { ++final class MutableExceptionCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,7 +42,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassExtendsGenericClass() throws Exception { ++ void classExtendsGenericClass() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -51,7 +51,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "14:9: " + getCheckMessage(MSG_KEY, "errorCode"), +@@ -63,7 +63,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleInputs() throws Exception { ++ void multipleInputs() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(MutableExceptionCheck.class); + final String filePath1 = getPath("InputMutableException2.java"); + final String filePath2 = getPath("InputMutableExceptionMultipleInputs.java"); +@@ -87,7 +87,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFormat() throws Exception { ++ void format() throws Exception { + final String[] expected = { + "42:13: " + getCheckMessage(MSG_KEY, "errorCode"), + }; +@@ -96,7 +96,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNested() throws Exception { ++ void nested() throws Exception { + + final String[] expected = { + "15:9: " + getCheckMessage(MSG_KEY, "code"), +@@ -106,7 +106,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MutableExceptionCheck obj = new MutableExceptionCheck(); + final int[] expected = {TokenTypes.CLASS_DEF, TokenTypes.VARIABLE_DEF}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -115,7 +115,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MutableExceptionCheck obj = new MutableExceptionCheck(); + final int[] expected = {TokenTypes.CLASS_DEF, TokenTypes.VARIABLE_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -124,7 +124,7 @@ public class MutableExceptionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongTokenType() { ++ void wrongTokenType() { + final MutableExceptionCheck obj = new MutableExceptionCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.INTERFACE_DEF, "interface")); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheckTest.java +index 4b31a7cdf..14d12f7d1 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/OneTopLevelClassCheckTest.java +@@ -32,7 +32,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { ++final class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final OneTopLevelClassCheck checkObj = new OneTopLevelClassCheck(); + final int[] expected = {TokenTypes.COMPILATION_UNIT}; + assertWithMessage("Required tokens are invalid.") +@@ -49,7 +49,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(OneTopLevelClassCheck.class); + final String firstInputFilePath = getPath("InputOneTopLevelClassDeclarationOrder.java"); + final String secondInputFilePath = getPath("InputOneTopLevelClassInterface2.java"); +@@ -75,7 +75,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptableTokens() { ++ void acceptableTokens() { + final OneTopLevelClassCheck check = new OneTopLevelClassCheck(); + final int[] expected = {TokenTypes.COMPILATION_UNIT}; + assertWithMessage("Default required tokens are invalid") +@@ -84,31 +84,31 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithOneTopLevelClass() throws Exception { ++ void fileWithOneTopLevelClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOneTopLevelClass.java"), expected); + } + + @Test +- public void testFileWithOneTopLevelInterface() throws Exception { ++ void fileWithOneTopLevelInterface() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOneTopLevelClassInterface.java"), expected); + } + + @Test +- public void testFileWithOneTopLevelEnum() throws Exception { ++ void fileWithOneTopLevelEnum() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOneTopLevelClassEnum.java"), expected); + } + + @Test +- public void testFileWithOneTopLevelAnnotation() throws Exception { ++ void fileWithOneTopLevelAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOneTopLevelClassAnnotation.java"), expected); + } + + @Test +- public void testFileWithNoPublicTopLevelClass() throws Exception { ++ void fileWithNoPublicTopLevelClass() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassNoPublic2"), + }; +@@ -116,7 +116,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithThreeTopLevelInterface() throws Exception { ++ void fileWithThreeTopLevelInterface() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassInterface3inner1"), + "17:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassInterface3inner2"), +@@ -125,7 +125,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithThreeTopLevelEnum() throws Exception { ++ void fileWithThreeTopLevelEnum() throws Exception { + final String[] expected = { + "9:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassEnum2inner1"), + "17:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassEnum2inner2"), +@@ -134,7 +134,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithThreeTopLevelAnnotation() throws Exception { ++ void fileWithThreeTopLevelAnnotation() throws Exception { + final String[] expected = { + "15:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassAnnotation2A"), + "20:1: " + getCheckMessage(MSG_KEY, "InputOneTopLevelClassAnnotation2B"), +@@ -143,7 +143,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithFewTopLevelClasses() throws Exception { ++ void fileWithFewTopLevelClasses() throws Exception { + final String[] expected = { + "31:1: " + getCheckMessage(MSG_KEY, "NoSuperClone"), + "35:1: " + getCheckMessage(MSG_KEY, "InnerClone"), +@@ -157,7 +157,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithSecondEnumTopLevelClass() throws Exception { ++ void fileWithSecondEnumTopLevelClass() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_KEY, "InputDeclarationOrderEnum2"), + "26:1: " + getCheckMessage(MSG_KEY, "InputDeclarationOrderAnnotation2"), +@@ -166,13 +166,13 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfoWithNoTypesDeclared() throws Exception { ++ void packageInfoWithNoTypesDeclared() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getNonCompilablePath("package-info.java"), expected); + } + + @Test +- public void testFileWithMultipleSameLine() throws Exception { ++ void fileWithMultipleSameLine() throws Exception { + final String[] expected = { + "9:47: " + getCheckMessage(MSG_KEY, "ViolatingSecondType"), + }; +@@ -180,7 +180,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileWithIndentation() throws Exception { ++ void fileWithIndentation() throws Exception { + final String[] expected = { + "13:2: " + getCheckMessage(MSG_KEY, "ViolatingIndentedClass1"), + "17:5: " + getCheckMessage(MSG_KEY, "ViolatingIndentedClass2"), +@@ -190,7 +190,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOneTopLevelClassRecords() throws Exception { ++ void oneTopLevelClassRecords() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_KEY, "TestRecord1"), + "17:1: " + getCheckMessage(MSG_KEY, "TestRecord2"), +@@ -200,7 +200,7 @@ public class OneTopLevelClassCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOneTopLevelClassEmpty() throws Exception { ++ void oneTopLevelClassEmpty() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getNonCompilablePath("InputOneTopLevelClassEmpty.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java +index 60f415cef..c7a7bfd6a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/ThrowsCountCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class ThrowsCountCheckTest extends AbstractModuleTestSupport { ++final class ThrowsCountCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "25:20: " + getCheckMessage(MSG_KEY, 5, 4), +@@ -49,7 +49,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMax() throws Exception { ++ void max() throws Exception { + + final String[] expected = { + "35:20: " + getCheckMessage(MSG_KEY, 6, 5), +@@ -59,7 +59,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ThrowsCountCheck obj = new ThrowsCountCheck(); + final int[] expected = {TokenTypes.LITERAL_THROWS}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -68,7 +68,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ThrowsCountCheck obj = new ThrowsCountCheck(); + final int[] expected = {TokenTypes.LITERAL_THROWS}; + assertWithMessage("Default required tokens are invalid") +@@ -77,7 +77,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongTokenType() { ++ void wrongTokenType() { + final ThrowsCountCheck obj = new ThrowsCountCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.CLASS_DEF, "class")); +@@ -92,7 +92,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotIgnorePrivateMethod() throws Exception { ++ void notIgnorePrivateMethod() throws Exception { + final String[] expected = { + "25:20: " + getCheckMessage(MSG_KEY, 5, 4), + "30:20: " + getCheckMessage(MSG_KEY, 5, 4), +@@ -104,7 +104,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodWithAnnotation() throws Exception { ++ void methodWithAnnotation() throws Exception { + final String[] expected = { + "26:26: " + getCheckMessage(MSG_KEY, 5, 4), + }; +@@ -112,7 +112,7 @@ public class ThrowsCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOverriding() throws Exception { ++ void overriding() throws Exception { + final String[] expected = { + "17:20: " + getCheckMessage(MSG_KEY, 1, 0), + "21:20: " + getCheckMessage(MSG_KEY, 1, 0), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheckTest.java +index 1def39c03..ced375129 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/design/VisibilityModifierCheckTest.java +@@ -33,7 +33,7 @@ import java.io.File; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { ++final class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,7 +41,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final VisibilityModifierCheck checkObj = new VisibilityModifierCheck(); + final int[] expected = { + TokenTypes.VARIABLE_DEF, TokenTypes.IMPORT, +@@ -52,7 +52,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInner() throws Exception { ++ void inner() throws Exception { + final String[] expected = { + "47:24: " + getCheckMessage(MSG_KEY, "rData"), + "50:27: " + getCheckMessage(MSG_KEY, "protectedVariable"), +@@ -66,7 +66,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreAccess() throws Exception { ++ void ignoreAccess() throws Exception { + final String[] expected = { + "34:20: " + getCheckMessage(MSG_KEY, "fData"), + "94:20: " + getCheckMessage(MSG_KEY, "someValue"), +@@ -75,7 +75,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final String[] expected = { + "49:19: " + getCheckMessage(MSG_KEY, "mNumCreated2"), + "59:23: " + getCheckMessage(MSG_KEY, "sTest1"), +@@ -88,7 +88,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictJavadoc() throws Exception { ++ void strictJavadoc() throws Exception { + final String[] expected = { + "49:9: " + getCheckMessage(MSG_KEY, "mLen"), + "50:19: " + getCheckMessage(MSG_KEY, "mDeer"), +@@ -98,7 +98,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowPublicFinalFieldsInImmutableClass() throws Exception { ++ void allowPublicFinalFieldsInImmutableClass() throws Exception { + final String[] expected = { + "33:39: " + getCheckMessage(MSG_KEY, "includes"), + "34:39: " + getCheckMessage(MSG_KEY, "excludes"), +@@ -112,7 +112,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowPublicFinalFieldsInImmutableClassWithNonCanonicalClasses() throws Exception { ++ void allowPublicFinalFieldsInImmutableClassWithNonCanonicalClasses() throws Exception { + final String[] expected = { + "28:39: " + getCheckMessage(MSG_KEY, "includes"), + "29:39: " + getCheckMessage(MSG_KEY, "excludes"), +@@ -130,7 +130,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDisAllowPublicFinalAndImmutableFieldsInImmutableClass() throws Exception { ++ void disAllowPublicFinalAndImmutableFieldsInImmutableClass() throws Exception { + final String[] expected = { + "32:22: " + getCheckMessage(MSG_KEY, "someIntValue"), + "33:39: " + getCheckMessage(MSG_KEY, "includes"), +@@ -152,7 +152,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowPublicFinalFieldsInNonFinalClass() throws Exception { ++ void allowPublicFinalFieldsInNonFinalClass() throws Exception { + final String[] expected = { + "55:20: " + getCheckMessage(MSG_KEY, "value"), + "57:24: " + getCheckMessage(MSG_KEY, "bValue"), +@@ -162,7 +162,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUserSpecifiedImmutableClassesList() throws Exception { ++ void userSpecifiedImmutableClassesList() throws Exception { + final String[] expected = { + "30:29: " + getCheckMessage(MSG_KEY, "money"), + "47:35: " + getCheckMessage(MSG_KEY, "uri"), +@@ -177,7 +177,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImmutableSpecifiedSameTypeName() throws Exception { ++ void immutableSpecifiedSameTypeName() throws Exception { + final String[] expected = { + "23:46: " + getCheckMessage(MSG_KEY, "calendar"), "28:45: " + getCheckMessage(MSG_KEY, "adr"), + }; +@@ -186,7 +186,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImmutableValueSameTypeName() throws Exception { ++ void immutableValueSameTypeName() throws Exception { + final String[] expected = { + "28:46: " + getCheckMessage(MSG_KEY, "calendar"), + "29:59: " + getCheckMessage(MSG_KEY, "calendar2"), +@@ -198,21 +198,21 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImmutableStarImportFalseNegative() throws Exception { ++ void immutableStarImportFalseNegative() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputVisibilityModifierImmutableStarImport.java"), expected); + } + + @Test +- public void testImmutableStarImportNoWarn() throws Exception { ++ void immutableStarImportNoWarn() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputVisibilityModifierImmutableStarImport2.java"), expected); + } + + @Test +- public void testDefaultAnnotationPatterns() throws Exception { ++ void defaultAnnotationPatterns() throws Exception { + final String[] expected = { + "61:19: " + getCheckMessage(MSG_KEY, "customAnnotatedPublic"), + "64:12: " + getCheckMessage(MSG_KEY, "customAnnotatedPackage"), +@@ -225,7 +225,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomAnnotationPatterns() throws Exception { ++ void customAnnotationPatterns() throws Exception { + final String[] expected = { + "37:28: " + getCheckMessage(MSG_KEY, "publicJUnitRule"), + "40:28: " + getCheckMessage(MSG_KEY, "fqPublicJUnitRule"), +@@ -245,7 +245,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreAnnotationNoPattern() throws Exception { ++ void ignoreAnnotationNoPattern() throws Exception { + final String[] expected = { + "36:28: " + getCheckMessage(MSG_KEY, "publicJUnitRule"), + "39:28: " + getCheckMessage(MSG_KEY, "fqPublicJUnitRule"), +@@ -268,7 +268,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreAnnotationSameName() throws Exception { ++ void ignoreAnnotationSameName() throws Exception { + final String[] expected = { + "32:28: " + getCheckMessage(MSG_KEY, "publicJUnitRule"), + "35:28: " + getCheckMessage(MSG_KEY, "publicJUnitClassRule"), +@@ -278,7 +278,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final VisibilityModifierCheck obj = new VisibilityModifierCheck(); + final int[] expected = { + TokenTypes.VARIABLE_DEF, TokenTypes.IMPORT, +@@ -289,7 +289,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPublicImmutableFieldsNotAllowed() throws Exception { ++ void publicImmutableFieldsNotAllowed() throws Exception { + final String[] expected = { + "31:22: " + getCheckMessage(MSG_KEY, "someIntValue"), + "32:39: " + getCheckMessage(MSG_KEY, "includes"), +@@ -301,7 +301,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPublicFinalFieldsNotAllowed() throws Exception { ++ void publicFinalFieldsNotAllowed() throws Exception { + final String[] expected = { + "31:22: " + getCheckMessage(MSG_KEY, "someIntValue"), + "32:39: " + getCheckMessage(MSG_KEY, "includes"), +@@ -314,14 +314,14 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPublicFinalFieldsAllowed() throws Exception { ++ void publicFinalFieldsAllowed() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputVisibilityModifiersPublicImmutable3.java"), expected); + } + + @Test +- public void testPublicFinalFieldInEnum() throws Exception { ++ void publicFinalFieldInEnum() throws Exception { + final String[] expected = { + "35:23: " + getCheckMessage(MSG_KEY, "hole"), + }; +@@ -329,7 +329,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongTokenType() { ++ void wrongTokenType() { + final VisibilityModifierCheck obj = new VisibilityModifierCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.CLASS_DEF, "class")); +@@ -344,7 +344,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullModifiers() throws Exception { ++ void nullModifiers() throws Exception { + final String[] expected = { + "32:50: " + getCheckMessage(MSG_KEY, "i"), + }; +@@ -352,7 +352,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisibilityModifiersOfGenericFields() throws Exception { ++ void visibilityModifiersOfGenericFields() throws Exception { + final String[] expected = { + "31:56: " + getCheckMessage(MSG_KEY, "perfSeries"), + "32:66: " + getCheckMessage(MSG_KEY, "peopleMap"), +@@ -387,7 +387,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + * @throws Exception when exception occurred during execution. + */ + @Test +- public void testIsStarImportNullAst() throws Exception { ++ void isStarImportNullAst() throws Exception { + final DetailAST importAst = + JavaParser.parseFile( + new File(getPath("InputVisibilityModifierIsStarImport.java")), +@@ -401,7 +401,7 @@ public class VisibilityModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageClassName() throws Exception { ++ void packageClassName() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputVisibilityModifierPackageClassName.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheckTest.java +index ab69c7921..38cec276b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/HeaderCheckTest.java +@@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + import org.mockito.MockedConstruction; + +-public class HeaderCheckTest extends AbstractModuleTestSupport { ++final class HeaderCheckTest extends AbstractModuleTestSupport { + + @TempDir public File temporaryFolder; + +@@ -50,7 +50,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticHeader() throws Exception { ++ void staticHeader() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); + checkConfig.addProperty("ignoreLines", ""); +@@ -61,7 +61,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoHeader() throws Exception { ++ void noHeader() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + + createChecker(checkConfig); +@@ -70,7 +70,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceHeader() throws Exception { ++ void whitespaceHeader() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("header", "\n \n"); + +@@ -80,7 +80,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonExistentHeaderFile() throws Exception { ++ void nonExistentHeaderFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("nonExistent.file")); + final CheckstyleException ex = +@@ -106,7 +106,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidCharset() throws Exception { ++ void invalidCharset() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); + checkConfig.addProperty("charset", "XSO-8859-1"); +@@ -133,7 +133,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyFilename() { ++ void emptyFilename() { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", ""); + final CheckstyleException ex = +@@ -161,7 +161,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullFilename() { ++ void nullFilename() { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", null); + final CheckstyleException ex = +@@ -180,7 +180,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatch() throws Exception { ++ void notMatch() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); + checkConfig.addProperty("ignoreLines", ""); +@@ -195,7 +195,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnore() throws Exception { ++ void ignore() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); + checkConfig.addProperty("ignoreLines", "2"); +@@ -204,7 +204,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetHeaderTwice() { ++ void setHeaderTwice() { + final HeaderCheck check = new HeaderCheck(); + check.setHeader("Header"); + final IllegalArgumentException ex = +@@ -220,7 +220,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIoExceptionWhenLoadingHeaderFile() throws Exception { ++ void ioExceptionWhenLoadingHeaderFile() throws Exception { + final HeaderCheck check = new HeaderCheck(); + check.setHeaderFile(new URI("test://bad")); + +@@ -236,7 +236,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheHeaderFile() throws Exception { ++ void cacheHeaderFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); + +@@ -254,7 +254,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheHeaderWithoutFile() throws Exception { ++ void cacheHeaderWithoutFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("header", "Test"); + +@@ -270,7 +270,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreLinesSorted() throws Exception { ++ void ignoreLinesSorted() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.header")); + checkConfig.addProperty("ignoreLines", "4,2,3"); +@@ -279,7 +279,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLoadHeaderFileTwice() { ++ void loadHeaderFileTwice() { + final HeaderCheck check = new HeaderCheck(); + check.setHeader("Header"); + final ReflectiveOperationException ex = +@@ -294,21 +294,21 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHeaderIsValidWithBlankLines() throws Exception { ++ void headerIsValidWithBlankLines() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.blank-lines.header")); + verify(checkConfig, getPath("InputHeaderBlankLines.java")); + } + + @Test +- public void testHeaderIsValidWithBlankLinesBlockStyle() throws Exception { ++ void headerIsValidWithBlankLinesBlockStyle() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(HeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputHeaderjava.blank-lines2.header")); + verify(checkConfig, getPath("InputHeaderBlankLines2.java")); + } + + @Test +- public void testExternalResource() throws Exception { ++ void externalResource() throws Exception { + final HeaderCheck check = new HeaderCheck(); + final URI uri = CommonUtil.getUriByFilename(getPath("InputHeaderjava.header")); + check.setHeaderFile(uri); +@@ -320,7 +320,7 @@ public class HeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIoExceptionWhenLoadingHeader() { ++ void ioExceptionWhenLoadingHeader() { + final HeaderCheck check = new HeaderCheck(); + try (MockedConstruction mocked = + mockConstruction( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheckTest.java +index ad0c0bce4..61746e007 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/header/RegexpHeaderCheckTest.java +@@ -34,7 +34,7 @@ import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; + + /** Unit test for RegexpHeaderCheck. */ +-public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { ++final class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -43,7 +43,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + + /** Test of setHeader method, of class RegexpHeaderCheck. */ + @Test +- public void testSetHeaderNull() { ++ void setHeaderNull() { + // check null passes + final RegexpHeaderCheck instance = new RegexpHeaderCheck(); + // recreate for each test because multiple invocations fail +@@ -58,7 +58,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + + /** Test of setHeader method, of class RegexpHeaderCheck. */ + @Test +- public void testSetHeaderEmpty() { ++ void setHeaderEmpty() { + // check null passes + final RegexpHeaderCheck instance = new RegexpHeaderCheck(); + // check empty string passes +@@ -73,7 +73,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + + /** Test of setHeader method, of class RegexpHeaderCheck. */ + @Test +- public void testSetHeaderSimple() { ++ void setHeaderSimple() { + final RegexpHeaderCheck instance = new RegexpHeaderCheck(); + // check valid header passes + final String header = "abc.*"; +@@ -87,7 +87,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + + /** Test of setHeader method, of class RegexpHeaderCheck. */ + @Test +- public void testSetHeader() { ++ void setHeader() { + // check invalid header passes + final RegexpHeaderCheck instance = new RegexpHeaderCheck(); + try { +@@ -107,7 +107,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + createChecker(checkConfig); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -115,7 +115,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyFilename() throws Exception { ++ void emptyFilename() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", ""); + try { +@@ -132,7 +132,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeader() throws Exception { ++ void regexpHeader() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader.header")); + final String[] expected = { +@@ -142,7 +142,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingRegexpHeader() throws Exception { ++ void nonMatchingRegexpHeader() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("header", "\\/\\/ Nth Line of Header\\n\\/\\/ Nth Line of Header\\n"); + checkConfig.addProperty("multiLines", "1"); +@@ -153,7 +153,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderUrl() throws Exception { ++ void regexpHeaderUrl() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getUriString("InputRegexpHeader.header")); + final String[] expected = { +@@ -163,7 +163,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineRegexpHeader() throws Exception { ++ void inlineRegexpHeader() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("header", "^/*$\\n// .*\\n// Created: 2002\\n^//.*\\n^//.*"); + final String[] expected = { +@@ -173,7 +173,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFailureForMultilineRegexp() throws Exception { ++ void failureForMultilineRegexp() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("header", "^(.*\\n.*)"); + try { +@@ -191,7 +191,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineRegexpHeaderConsecutiveNewlines() throws Exception { ++ void inlineRegexpHeaderConsecutiveNewlines() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("header", "^/*$\\n// .*\\n\\n// Created: 2017\\n^//.*"); + final String[] expected = { +@@ -201,7 +201,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineRegexpHeaderConsecutiveNewlinesThroughConfigFile() throws Exception { ++ void inlineRegexpHeaderConsecutiveNewlinesThroughConfigFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getUriString("InputRegexpHeaderNewLines.header")); + final String[] expected = { +@@ -211,7 +211,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderIgnore() throws Exception { ++ void regexpHeaderIgnore() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader1.header")); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -219,7 +219,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderMulti1() throws Exception { ++ void regexpHeaderMulti1() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2.header")); + checkConfig.addProperty("multiLines", "3, 6"); +@@ -228,7 +228,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderMulti2() throws Exception { ++ void regexpHeaderMulti2() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2.header")); + checkConfig.addProperty("multiLines", "3, 6"); +@@ -237,7 +237,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderMulti3() throws Exception { ++ void regexpHeaderMulti3() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2.header")); + checkConfig.addProperty("multiLines", "3, 7"); +@@ -246,7 +246,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderMulti4() throws Exception { ++ void regexpHeaderMulti4() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2.header")); + checkConfig.addProperty("multiLines", "3, 5, 6, 7"); +@@ -255,7 +255,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderMulti5() throws Exception { ++ void regexpHeaderMulti5() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2.header")); + checkConfig.addProperty("multiLines", "3"); +@@ -266,7 +266,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderMulti6() throws Exception { ++ void regexpHeaderMulti6() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2_4.header")); + checkConfig.addProperty("multiLines", "8974382"); +@@ -275,7 +275,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderSmallHeader() throws Exception { ++ void regexpHeaderSmallHeader() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2.header")); + checkConfig.addProperty("multiLines", "3, 6"); +@@ -284,7 +284,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyMultiline() throws Exception { ++ void emptyMultiline() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader2.header")); + checkConfig.addProperty("multiLines", ""); +@@ -295,7 +295,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegexpHeaderMulti52() throws Exception { ++ void regexpHeaderMulti52() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader3.header")); + final String[] expected = { +@@ -305,7 +305,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreLinesSorted() throws Exception { ++ void ignoreLinesSorted() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader5.header")); + checkConfig.addProperty("multiLines", "7,5,3"); +@@ -314,7 +314,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHeaderWithInvalidRegexp() throws Exception { ++ void headerWithInvalidRegexp() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader.invalid.header")); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -330,7 +330,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoWarningIfSingleLinedLeft() throws Exception { ++ void noWarningIfSingleLinedLeft() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader4.header")); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -338,7 +338,7 @@ public class RegexpHeaderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoHeaderMissingErrorInCaseHeaderSizeEqualToFileSize() throws Exception { ++ void noHeaderMissingErrorInCaseHeaderSizeEqualToFileSize() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpHeaderCheck.class); + checkConfig.addProperty("headerFile", getPath("InputRegexpHeader3.header")); + checkConfig.addProperty("multiLines", "1"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResultTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResultTest.java +index 913489ef1..e90dcb224 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResultTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AccessResultTest.java +@@ -23,14 +23,14 @@ import static com.google.common.truth.Truth.assertWithMessage; + + import org.junit.jupiter.api.Test; + +-public class AccessResultTest { ++final class AccessResultTest { + + /* Additional test for jacoco, since valueOf() + * is generated by javac and jacoco reports that + * valueOf() is uncovered. + */ + @Test +- public void testAccessResultValueOf() { ++ void accessResultValueOf() { + final AccessResult result = AccessResult.valueOf("ALLOWED"); + assertWithMessage("Invalid access result").that(result).isEqualTo(AccessResult.ALLOWED); + } +@@ -40,7 +40,7 @@ public class AccessResultTest { + * values() is uncovered. + */ + @Test +- public void testAccessResultValues() { ++ void accessResultValues() { + final AccessResult[] actual = AccessResult.values(); + final AccessResult[] expected = { + AccessResult.ALLOWED, AccessResult.DISALLOWED, AccessResult.UNKNOWN, +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java +index 192c8b7b9..81c444c64 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStarImportCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { ++final class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultOperation() throws Exception { ++ void defaultOperation() throws Exception { + final String[] expected = { + "12:54: " + getCheckMessage(MSG_KEY, "com.puppycrawl." + "tools.checkstyle.checks.imports.*"), + "14:15: " + getCheckMessage(MSG_KEY, "java.io.*"), +@@ -48,7 +48,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludes() throws Exception { ++ void excludes() throws Exception { + // allow the java.io/java.lang,javax.swing.WindowConstants star imports + final String[] expected2 = { + "12:54: " + getCheckMessage(MSG_KEY, "com.puppycrawl." + "tools.checkstyle.checks.imports.*"), +@@ -58,7 +58,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowClassImports() throws Exception { ++ void allowClassImports() throws Exception { + // allow all class star imports + final String[] expected2 = { + "30:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), +@@ -69,7 +69,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowStaticMemberImports() throws Exception { ++ void allowStaticMemberImports() throws Exception { + // allow all static star imports + final String[] expected2 = { + "12:54: " + getCheckMessage(MSG_KEY, "com.puppycrawl." + "tools.checkstyle.checks.imports.*"), +@@ -80,7 +80,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AvoidStarImportCheck testCheckObject = new AvoidStarImportCheck(); + final int[] actual = testCheckObject.getAcceptableTokens(); + final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; +@@ -88,7 +88,7 @@ public class AvoidStarImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AvoidStarImportCheck testCheckObject = new AvoidStarImportCheck(); + final int[] actual = testCheckObject.getRequiredTokens(); + final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheckTest.java +index 2af9e0758..c7a7813a7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/AvoidStaticImportCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { ++final class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AvoidStaticImportCheck checkObj = new AvoidStaticImportCheck(); + final int[] expected = {TokenTypes.STATIC_IMPORT}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultOperation() throws Exception { ++ void defaultOperation() throws Exception { + final String[] expected = { + "26:27: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), + "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), +@@ -67,7 +67,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStarExcludes() throws Exception { ++ void starExcludes() throws Exception { + // allow the "java.io.File.*" AND "sun.net.ftpclient.FtpClient.*" star imports + final String[] expected = { + "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), +@@ -88,7 +88,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMemberExcludes() throws Exception { ++ void memberExcludes() throws Exception { + // allow the java.io.File.listRoots and java.lang.Math.E member imports + final String[] expected = { + "28:42: " + getCheckMessage(MSG_KEY, "javax.swing.WindowConstants.*"), +@@ -110,7 +110,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBogusMemberExcludes() throws Exception { ++ void bogusMemberExcludes() throws Exception { + // should NOT mask anything + final String[] expected = { + "28:27: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), +@@ -134,7 +134,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerClassMemberExcludesStar() throws Exception { ++ void innerClassMemberExcludesStar() throws Exception { + // should mask com.puppycrawl.tools.checkstyle.imports.avoidstaticimport. + // InputAvoidStaticImportNestedClass.InnerClass.one + final String[] expected = { +@@ -154,7 +154,7 @@ public class AvoidStaticImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AvoidStaticImportCheck testCheckObject = new AvoidStaticImportCheck(); + final int[] actual = testCheckObject.getAcceptableTokens(); + final int[] expected = {TokenTypes.STATIC_IMPORT}; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ClassImportRuleTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ClassImportRuleTest.java +index dbadbb515..a4560c6f2 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ClassImportRuleTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ClassImportRuleTest.java +@@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; + + import org.junit.jupiter.api.Test; + +-public class ClassImportRuleTest { ++final class ClassImportRuleTest { + + @Test +- public void testClassImportRule() { ++ void classImportRule() { + final ClassImportRule rule = new ClassImportRule(true, false, "pkg.a", false); + assertWithMessage("Class import rule should not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -50,7 +50,7 @@ public class ClassImportRuleTest { + } + + @Test +- public void testClassImportRuleRegexpSimple() { ++ void classImportRuleRegexpSimple() { + final ClassImportRule rule = new ClassImportRule(true, false, "pkg.a", true); + assertWithMessage("Class import rule should not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -74,7 +74,7 @@ public class ClassImportRuleTest { + } + + @Test +- public void testClassImportRuleRegexp() { ++ void classImportRuleRegexp() { + final ClassImportRule rule = new ClassImportRule(true, false, "pk[gx]\\.a", true); + assertWithMessage("Class import rule should not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java +index 0d25e68ee..69ae70cf4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/CustomImportOrderCheckTest.java +@@ -38,7 +38,7 @@ import java.io.File; + import java.lang.reflect.Method; + import org.junit.jupiter.api.Test; + +-public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { ++final class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + + /** Shortcuts to make code more compact. */ + private static final String STATIC = CustomImportOrderCheck.STATIC_RULE_GROUP; +@@ -54,7 +54,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final CustomImportOrderCheck checkObj = new CustomImportOrderCheck(); + final int[] expected = { + TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT, TokenTypes.PACKAGE_DEF, +@@ -65,7 +65,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustom() throws Exception { ++ void custom() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), + "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), +@@ -90,7 +90,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + * configuration. + */ + @Test +- public void testStaticStandardThird() throws Exception { ++ void staticStandardThird() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), + "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), +@@ -110,7 +110,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + + /** Checks different combinations for same_package group. */ + @Test +- public void testNonSpecifiedImports() throws Exception { ++ void nonSpecifiedImports() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), + "17:1: " + getCheckMessage(MSG_LEX, "java.awt.print.Paper.*", "java.io.File.createTempFile"), +@@ -128,7 +128,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOrderRuleEmpty() throws Exception { ++ void orderRuleEmpty() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.List"), + }; +@@ -137,7 +137,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOrderRuleWithOneGroup() throws Exception { ++ void orderRuleWithOneGroup() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), + "19:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.List"), +@@ -167,7 +167,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticSamePackage() throws Exception { ++ void staticSamePackage() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_LEX, "java.util.*", "java.util.StringTokenizer"), + "18:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), +@@ -186,7 +186,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithoutLineSeparator() throws Exception { ++ void withoutLineSeparator() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_LEX, "java.util.*", "java.util.StringTokenizer"), + "18:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), +@@ -205,7 +205,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithoutLineSeparator2() throws Exception { ++ void withoutLineSeparator2() throws Exception { + final String[] expected = { + "16:1: " + + getCheckMessage( +@@ -221,14 +221,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoValid() throws Exception { ++ void noValid() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputCustomImportOrderNoValid.java"), expected); + } + + @Test +- public void testPossibleIndexOutOfBoundsException() throws Exception { ++ void possibleIndexOutOfBoundsException() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, THIRD, "org.w3c.dom.Node"), + }; +@@ -238,7 +238,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultPackage2() throws Exception { ++ void defaultPackage2() throws Exception { + + final String[] expected = { + "19:1: " + getCheckMessage(MSG_LEX, "java.awt.Button.ABORT", "java.io.File.createTempFile"), +@@ -261,7 +261,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithoutThirdPartyPackage() throws Exception { ++ void withoutThirdPartyPackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -269,7 +269,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThirdPartyAndSpecialImports() throws Exception { ++ void thirdPartyAndSpecialImports() throws Exception { + final String[] expected = { + "23:1: " + + getCheckMessage(MSG_ORDER, THIRD, SPECIAL, "com.google.common.collect.HashMultimap"), +@@ -280,7 +280,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompareImports() throws Exception { ++ void compareImports() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_LEX, "java.util.Map", "java.util.Map.Entry"), + }; +@@ -289,7 +289,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFindBetterPatternMatch() throws Exception { ++ void findBetterPatternMatch() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_ORDER, THIRD, SPECIAL, "com.google.common.annotations.Beta"), + }; +@@ -299,7 +299,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBeginTreeClear() throws Exception { ++ void beginTreeClear() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(CustomImportOrderCheck.class); + checkConfig.addProperty("specialImportsRegExp", "com"); + checkConfig.addProperty("separateLineBetweenGroups", "false"); +@@ -315,7 +315,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportsContainingJava() throws Exception { ++ void importsContainingJava() throws Exception { + final String[] expected = { + "17:1: " + + getCheckMessage( +@@ -328,7 +328,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final CustomImportOrderCheck testCheckObject = new CustomImportOrderCheck(); + final int[] actual = testCheckObject.getAcceptableTokens(); + final int[] expected = { +@@ -341,7 +341,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + @Test + // UT uses Reflection to avoid removing null-validation from static method, + // which is a candidate for utility method in the future +- public void testGetFullImportIdent() throws Exception { ++ void getFullImportIdent() throws Exception { + final Class clazz = CustomImportOrderCheck.class; + final Object t = clazz.getConstructor().newInstance(); + final Method method = clazz.getDeclaredMethod("getFullImportIdent", DetailAST.class); +@@ -353,7 +353,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSamePackageDepth2() throws Exception { ++ void samePackageDepth2() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.*"), + "21:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.List"), +@@ -373,7 +373,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSamePackageDepth3() throws Exception { ++ void samePackageDepth3() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.*"), + "24:1: " +@@ -388,7 +388,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSamePackageDepth4() throws Exception { ++ void samePackageDepth4() throws Exception { + final String[] expected = { + "25:1: " + + getCheckMessage(MSG_NONGROUP_EXPECTED, SAME, "java.util.concurrent.locks.LockSupport"), +@@ -399,7 +399,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSamePackageDepthLongerThenActualPackage() throws Exception { ++ void samePackageDepthLongerThenActualPackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -407,7 +407,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSamePackageDepthNegative() throws Exception { ++ void samePackageDepthNegative() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -432,7 +432,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSamePackageDepthZero() throws Exception { ++ void samePackageDepthZero() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -455,7 +455,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnsupportedRule() throws Exception { ++ void unsupportedRule() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -477,7 +477,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSamePackageDepthNotInt() throws Exception { ++ void samePackageDepthNotInt() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -499,14 +499,14 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoImports() throws Exception { ++ void noImports() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputCustomImportOrder_NoImports.java"), expected); + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.awt.Button"), + "32:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "com.puppycrawl.tools.checkstyle.*"), +@@ -516,7 +516,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRulesWithOverlappingPatterns() throws Exception { ++ void rulesWithOverlappingPatterns() throws Exception { + final String[] expected = { + "23:1: " + + getCheckMessage( +@@ -559,28 +559,28 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiplePatternMatchesSecondPatternIsLonger() throws Exception { ++ void multiplePatternMatchesSecondPatternIsLonger() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputCustomImportOrder_MultiplePatternMatches.java"), expected); + } + + @Test +- public void testMultiplePatternMatchesFirstPatternHasLaterPosition() throws Exception { ++ void multiplePatternMatchesFirstPatternHasLaterPosition() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputCustomImportOrder_MultiplePatternMatches2.java"), expected); + } + + @Test +- public void testMultiplePatternMatchesFirstPatternHasEarlierPosition() throws Exception { ++ void multiplePatternMatchesFirstPatternHasEarlierPosition() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputCustomImportOrder_MultiplePatternMatches3.java"), expected); + } + + @Test +- public void testMultiplePatternMultipleImportFirstPatternHasLaterPosition() throws Exception { ++ void multiplePatternMultipleImportFirstPatternHasLaterPosition() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "org.junit.Test"), + }; +@@ -589,7 +589,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoPackage() throws Exception { ++ void noPackage() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.*"), + "19:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.HashMap"), +@@ -601,7 +601,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoPackage2() throws Exception { ++ void noPackage2() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.sun.accessibility.internal.resources.*"), + "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Arrays"), +@@ -614,7 +614,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoPackage3() throws Exception { ++ void noPackage3() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), + "25:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "org.apache.*"), +@@ -625,7 +625,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputCustomImportOrderSingleLine() throws Exception { ++ void inputCustomImportOrderSingleLine() throws Exception { + final String[] expected = { + "14:112: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), + "15:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "com.google.common.annotations.Beta"), +@@ -636,7 +636,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputCustomImportOrderSingleLine2() throws Exception { ++ void inputCustomImportOrderSingleLine2() throws Exception { + final String[] expected = { + "14:118: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.util.Map"), + }; +@@ -645,7 +645,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputCustomImportOrderThirdPartyAndSpecial2() throws Exception { ++ void inputCustomImportOrderThirdPartyAndSpecial2() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.WindowConstants.*"), + "24:1: " + getCheckMessage(MSG_LINE_SEPARATOR, "java.awt.Button"), +@@ -664,7 +664,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputCustomImportOrderMultipleViolationsSameLine() throws Exception { ++ void inputCustomImportOrderMultipleViolationsSameLine() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STATIC, "java.util.Collections.*"), + "18:1: " +@@ -678,7 +678,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputCustomImportOrderSpanMultipleLines() throws Exception { ++ void inputCustomImportOrderSpanMultipleLines() throws Exception { + final String[] expected = { + "30:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.BitSet"), + "45:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.HashSet"), +@@ -691,7 +691,7 @@ public class CustomImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputCustomImportOrderEclipseDefaultPositive() throws Exception { ++ void inputCustomImportOrderEclipseDefaultPositive() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "java.awt.Button"), + "23:1: " + getCheckMessage(MSG_NONGROUP_EXPECTED, STD, "java.awt.Dialog"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/FileImportControlTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/FileImportControlTest.java +index 6b2588da6..9cbcfc0d6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/FileImportControlTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/FileImportControlTest.java +@@ -24,7 +24,7 @@ import static com.google.common.truth.Truth.assertWithMessage; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class FileImportControlTest { ++final class FileImportControlTest { + + private final PkgImportControl root = + new PkgImportControl("com.kazgroup.courtlink", false, MismatchStrategy.DISALLOWED); +@@ -33,7 +33,7 @@ public class FileImportControlTest { + private final FileImportControl fileRegexpNode = new FileImportControl(root, ".*Other.*", true); + + @BeforeEach +- public void setUp() { ++ void setUp() { + root.addChild(fileNode); + root.addChild(fileRegexpNode); + +@@ -43,7 +43,7 @@ public class FileImportControlTest { + } + + @Test +- public void testLocateFinest() { ++ void locateFinest() { + assertWithMessage("Unexpected response") + .that(root.locateFinest("com.kazgroup.courtlink.domain", "Random")) + .isEqualTo(root); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheckTest.java +index 667be93f7..1236a0802 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/IllegalImportCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class IllegalImportCheckTest extends AbstractModuleTestSupport { ++final class IllegalImportCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final IllegalImportCheck checkObj = new IllegalImportCheck(); + final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithSupplied() throws Exception { ++ void withSupplied() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY, "java.io.*"), + "28:1: " + getCheckMessage(MSG_KEY, "java.io.File.listRoots"), +@@ -53,13 +53,13 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithDefault() throws Exception { ++ void withDefault() throws Exception { + final String[] expected = {}; + verifyWithInlineConfigParser(getPath("InputIllegalImportDefault2.java"), expected); + } + + @Test +- public void testCustomSunPackageWithRegexp() throws Exception { ++ void customSunPackageWithRegexp() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY, "sun.reflect.*"), + }; +@@ -67,7 +67,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final IllegalImportCheck testCheckObject = new IllegalImportCheck(); + final int[] actual = testCheckObject.getAcceptableTokens(); + final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; +@@ -76,7 +76,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalClasses() throws Exception { ++ void illegalClasses() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_KEY, "java.sql.Connection"), + "20:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), +@@ -86,7 +86,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalClassesStarImport() throws Exception { ++ void illegalClassesStarImport() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_KEY, "java.io.*"), + "20:1: " + getCheckMessage(MSG_KEY, "org.junit.jupiter.api.*"), +@@ -96,7 +96,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalPackagesRegularExpression() throws Exception { ++ void illegalPackagesRegularExpression() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "18:1: " + getCheckMessage(MSG_KEY, "java.util.List"), +@@ -110,7 +110,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalClassesRegularExpression() throws Exception { ++ void illegalClassesRegularExpression() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "18:1: " + getCheckMessage(MSG_KEY, "java.util.List"), +@@ -120,7 +120,7 @@ public class IllegalImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalPackagesAndClassesRegularExpression() throws Exception { ++ void illegalPackagesAndClassesRegularExpression() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_KEY, "java.util.List"), + "18:1: " + getCheckMessage(MSG_KEY, "java.util.List"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheckTest.java +index 8b3a72690..6743528fe 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlCheckTest.java +@@ -35,7 +35,7 @@ import java.nio.file.Files; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + +-public class ImportControlCheckTest extends AbstractModuleTestSupport { ++final class ImportControlCheckTest extends AbstractModuleTestSupport { + + @TempDir public File temporaryFolder; + +@@ -45,7 +45,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ImportControlCheck checkObj = new ImportControlCheck(); + final int[] expected = { + TokenTypes.PACKAGE_DEF, TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT, +@@ -56,14 +56,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOne() throws Exception { ++ void one() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl.java"), expected); + } + + @Test +- public void testTwo() throws Exception { ++ void two() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), +@@ -74,31 +74,31 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrong() throws Exception { ++ void wrong() throws Exception { + final String[] expected = {"9:1: " + getCheckMessage(MSG_UNKNOWN_PKG)}; + verifyWithInlineConfigParser(getPath("InputImportControl3.java"), expected); + } + + @Test +- public void testMissing() throws Exception { ++ void missing() throws Exception { + final String[] expected = {"9:1: " + getCheckMessage(MSG_MISSING_FILE)}; + verifyWithInlineConfigParser(getPath("InputImportControl4.java"), expected); + } + + @Test +- public void testEmpty() throws Exception { ++ void empty() throws Exception { + final String[] expected = {"9:1: " + getCheckMessage(MSG_MISSING_FILE)}; + verifyWithInlineConfigParser(getPath("InputImportControl5.java"), expected); + } + + @Test +- public void testNull() throws Exception { ++ void testNull() throws Exception { + final String[] expected = {"9:1: " + getCheckMessage(MSG_MISSING_FILE)}; + verifyWithInlineConfigParser(getPath("InputImportControl6.java"), expected); + } + + @Test +- public void testUnknown() throws Exception { ++ void unknown() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputImportControl7.java"), expected); +@@ -114,7 +114,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBroken() throws Exception { ++ void broken() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputImportControl8.java"), expected); +@@ -130,14 +130,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOneRegExp() throws Exception { ++ void oneRegExp() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl9.java"), expected); + } + + @Test +- public void testTwoRegExp() throws Exception { ++ void twoRegExp() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), +@@ -148,14 +148,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotRegExpNoMatch() throws Exception { ++ void notRegExpNoMatch() throws Exception { + + verifyWithInlineConfigParser( + getPath("InputImportControl11.java"), CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testBlacklist() throws Exception { ++ void blacklist() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.util.stream.Stream"), + "12:1: " + getCheckMessage(MSG_DISALLOWED, "java.util.Date"), +@@ -167,7 +167,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrategyOnMismatchOne() throws Exception { ++ void strategyOnMismatchOne() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), +@@ -178,7 +178,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrategyOnMismatchTwo() throws Exception { ++ void strategyOnMismatchTwo() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + "14:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Button.ABORT"), +@@ -188,7 +188,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrategyOnMismatchThree() throws Exception { ++ void strategyOnMismatchThree() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + }; +@@ -197,7 +197,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrategyOnMismatchFour() throws Exception { ++ void strategyOnMismatchFour() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + "12:1: " + getCheckMessage(MSG_DISALLOWED, "javax.swing.border.*"), +@@ -207,7 +207,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithoutRegexAndWithStrategyOnMismatch() throws Exception { ++ void withoutRegexAndWithStrategyOnMismatch() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -215,28 +215,28 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPkgRegExpInParent() throws Exception { ++ void pkgRegExpInParent() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl16.java"), expected); + } + + @Test +- public void testPkgRegExpInChild() throws Exception { ++ void pkgRegExpInChild() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl162.java"), expected); + } + + @Test +- public void testPkgRegExpInBoth() throws Exception { ++ void pkgRegExpInBoth() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl163.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ImportControlCheck testCheckObject = new ImportControlCheck(); + final int[] actual = testCheckObject.getAcceptableTokens(); + final int[] expected = { +@@ -247,14 +247,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testResource() throws Exception { ++ void resource() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl17.java"), expected); + } + + @Test +- public void testResourceUnableToLoad() throws Exception { ++ void resourceUnableToLoad() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputImportControl18.java"), expected); +@@ -270,14 +270,14 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUrlInFileProperty() throws Exception { ++ void urlInFileProperty() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl19.java"), expected); + } + + @Test +- public void testUrlInFilePropertyUnableToLoad() throws Exception { ++ void urlInFilePropertyUnableToLoad() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -294,7 +294,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCacheWhenFileExternalResourceContentDoesNotChange() throws Exception { ++ void cacheWhenFileExternalResourceContentDoesNotChange() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ImportControlCheck.class); + checkConfig.addProperty("file", getPath("InputImportControlOneRegExp.xml")); + +@@ -318,35 +318,35 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPathRegexMatches() throws Exception { ++ void pathRegexMatches() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl21.java"), expected); + } + + @Test +- public void testPathRegexMatchesPartially() throws Exception { ++ void pathRegexMatchesPartially() throws Exception { + final String[] expected = {"13:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File")}; + + verifyWithInlineConfigParser(getPath("InputImportControl22.java"), expected); + } + + @Test +- public void testPathRegexDoesntMatch() throws Exception { ++ void pathRegexDoesntMatch() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputImportControl23.java"), expected); + } + + @Test +- public void testPathRegexDoesntMatchPartially() throws Exception { ++ void pathRegexDoesntMatchPartially() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputImportControl24.java"), expected); + } + + @Test +- public void testDisallowClassOfAllowPackage() throws Exception { ++ void disallowClassOfAllowPackage() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(MSG_DISALLOWED, "java.util.Date"), + }; +@@ -356,7 +356,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileName() throws Exception { ++ void fileName() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + }; +@@ -365,7 +365,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithRegex() throws Exception { ++ void withRegex() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_DISALLOWED, "java.io.File"), + }; +@@ -374,7 +374,7 @@ public class ImportControlCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileNameNoExtension() throws Exception { ++ void fileNameNoExtension() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_DISALLOWED, "java.awt.Image"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoaderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoaderTest.java +index 2cb0efa51..13860aa9c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoaderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportControlLoaderTest.java +@@ -40,7 +40,7 @@ import org.xml.sax.SAXException; + import org.xml.sax.SAXParseException; + import org.xml.sax.helpers.AttributesImpl; + +-public class ImportControlLoaderTest { ++final class ImportControlLoaderTest { + + private static String getPath(String filename) { + return "src/test/resources/com/puppycrawl/tools/" +@@ -49,14 +49,14 @@ public class ImportControlLoaderTest { + } + + @Test +- public void testLoad() throws CheckstyleException { ++ void load() throws CheckstyleException { + final AbstractImportControl root = + ImportControlLoader.load(new File(getPath("InputImportControlLoaderComplete.xml")).toURI()); + assertWithMessage("Import root should not be null").that(root).isNotNull(); + } + + @Test +- public void testWrongFormatUri() throws Exception { ++ void wrongFormatUri() throws Exception { + try { + ImportControlLoader.load(new URI("aaa://" + getPath("InputImportControlLoaderComplete.xml"))); + assertWithMessage("exception expected").fail(); +@@ -73,7 +73,7 @@ public class ImportControlLoaderTest { + } + + @Test +- public void testExtraElementInConfig() throws Exception { ++ void extraElementInConfig() throws Exception { + final AbstractImportControl root = + ImportControlLoader.load( + new File(getPath("InputImportControlLoaderWithNewElement.xml")).toURI()); +@@ -82,7 +82,7 @@ public class ImportControlLoaderTest { + + @Test + // UT uses Reflection to avoid removing null-validation from static method +- public void testSafeGetThrowsException() { ++ void safeGetThrowsException() { + final AttributesImpl attr = + new AttributesImpl() { + @Override +@@ -113,7 +113,7 @@ public class ImportControlLoaderTest { + // UT uses Reflection to cover IOException from 'loader.parseInputSource(source);' + // because this is possible situation (though highly unlikely), which depends on hardware + // and is difficult to emulate +- public void testLoadThrowsException() { ++ void loadThrowsException() { + final InputSource source = new InputSource(); + try { + final Class clazz = ImportControlLoader.class; +@@ -135,12 +135,12 @@ public class ImportControlLoaderTest { + } + + @Test +- public void testInputStreamFailsOnRead() throws Exception { +- try (InputStream inputStream = mock(InputStream.class)) { ++ void inputStreamFailsOnRead() throws Exception { ++ try (InputStream inputStream = mock()) { + final int available = doThrow(IOException.class).when(inputStream).available(); +- final URL url = mock(URL.class); ++ final URL url = mock(); + when(url.openStream()).thenReturn(inputStream); +- final URI uri = mock(URI.class); ++ final URI uri = mock(); + when(uri.toURL()).thenReturn(url); + + final CheckstyleException ex = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckTest.java +index f042bbe17..8768d6c80 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/ImportOrderCheckTest.java +@@ -35,7 +35,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class ImportOrderCheckTest extends AbstractModuleTestSupport { ++final class ImportOrderCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -43,7 +43,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetTokens() { ++ void getTokens() { + final ImportOrderCheck checkObj = new ImportOrderCheck(); + final int[] expected = {TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT}; + assertWithMessage("Default tokens differs from expected") +@@ -62,13 +62,13 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testImportOrderOptionValueOf() { ++ void importOrderOptionValueOf() { + final ImportOrderOption option = ImportOrderOption.valueOf("TOP"); + assertWithMessage("Invalid valueOf result").that(option).isEqualTo(ImportOrderOption.TOP); + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), + "25:1: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"), +@@ -82,7 +82,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongSequenceInNonStaticImports() throws Exception { ++ void wrongSequenceInNonStaticImports() throws Exception { + + final String[] expected = { + "19:1: " + getCheckMessage(MSG_ORDERING, "java.util.HashMap"), +@@ -93,14 +93,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultilineImport() throws Exception { ++ void multilineImport() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getNonCompilablePath("InputImportOrderMultiline.java"), expected); + } + + @Test +- public void testGroups() throws Exception { ++ void groups() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), + "29:1: " + getCheckMessage(MSG_ORDERING, "java.io.IOException"), +@@ -113,7 +113,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGroupsRegexp() throws Exception { ++ void groupsRegexp() throws Exception { + final String[] expected = { + "27:1: " + getCheckMessage(MSG_ORDERING, "java.io.File"), + "34:1: " +@@ -124,7 +124,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSeparated() throws Exception { ++ void separated() throws Exception { + final String[] expected = { + "25:1: " + getCheckMessage(MSG_SEPARATION, "javax.swing.JComponent"), + "27:1: " + getCheckMessage(MSG_SEPARATION, "java.io.File"), +@@ -135,7 +135,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticImportSeparated() throws Exception { ++ void staticImportSeparated() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.cos"), + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.junit.Assert.assertEquals"), +@@ -145,7 +145,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoGapBetweenStaticImports() throws Exception { ++ void noGapBetweenStaticImports() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -153,7 +153,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSortStaticImportsAlphabeticallyFalse() throws Exception { ++ void sortStaticImportsAlphabeticallyFalse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -161,7 +161,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSortStaticImportsAlphabeticallyTrue() throws Exception { ++ void sortStaticImportsAlphabeticallyTrue() throws Exception { + final String[] expected = { + "20:1: " + + getCheckMessage(MSG_ORDERING, "javax.xml.transform.TransformerFactory.newInstance"), +@@ -174,14 +174,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseInsensitive() throws Exception { ++ void caseInsensitive() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputImportOrderCaseInsensitive.java"), expected); + } + + @Test +- public void testContainerCaseInsensitive() throws Exception { ++ void containerCaseInsensitive() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -189,7 +189,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSimilarGroupPattern() throws Exception { ++ void similarGroupPattern() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -197,7 +197,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -216,7 +216,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTop() throws Exception { ++ void top() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.awt.Button"), + "28:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.IOException"), +@@ -229,7 +229,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAbove() throws Exception { ++ void above() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Button.ABORT"), + "24:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), +@@ -242,7 +242,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInFlow() throws Exception { ++ void inFlow() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), + "25:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.JComponent"), +@@ -258,7 +258,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnder() throws Exception { ++ void under() throws Exception { + // is default (testDefault) + final String[] expected = { + "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), +@@ -271,7 +271,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBottom() throws Exception { ++ void bottom() throws Exception { + final String[] expected = { + "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.io.IOException"), + "27:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "javax.swing.JComponent"), +@@ -286,7 +286,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetGroupNumber() throws Exception { ++ void getGroupNumber() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -294,7 +294,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHonorsTokenProperty() throws Exception { ++ void honorsTokenProperty() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Button.ABORT"), + "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), +@@ -305,7 +305,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWildcard() throws Exception { ++ void wildcard() throws Exception { + final String[] expected = { + "25:1: " + getCheckMessage(MSG_ORDERING, "javax.crypto.Cipher"), + }; +@@ -314,7 +314,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWildcardUnspecified() throws Exception { ++ void wildcardUnspecified() throws Exception { + final String[] expected = { + "23:1: " + + getCheckMessage( +@@ -326,14 +326,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoFailureForRedundantImports() throws Exception { ++ void noFailureForRedundantImports() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputImportOrder_NoFailureForRedundantImports.java"), expected); + } + + @Test +- public void testStaticGroupsAlphabeticalOrder() throws Exception { ++ void staticGroupsAlphabeticalOrder() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), + "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), +@@ -343,7 +343,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsOrder() throws Exception { ++ void staticGroupsOrder() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), + "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), +@@ -352,7 +352,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsAlphabeticalOrderBottom() throws Exception { ++ void staticGroupsAlphabeticalOrderBottom() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), +@@ -361,7 +361,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsAlphabeticalOrderBottomNegative() throws Exception { ++ void staticGroupsAlphabeticalOrderBottomNegative() throws Exception { + final String[] expected = { + "24:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), + }; +@@ -373,7 +373,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + * Tests that a non-static import after a static import correctly gives an error if order=bottom. + */ + @Test +- public void testStaticGroupsAlphabeticalOrderTopNegative() throws Exception { ++ void staticGroupsAlphabeticalOrderTopNegative() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_ORDERING, "java.lang.Math.PI"), + }; +@@ -385,7 +385,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + * Tests that a non-static import before a static import correctly gives an error if order=top. + */ + @Test +- public void testStaticGroupsAlphabeticalOrderBottomNegative2() throws Exception { ++ void staticGroupsAlphabeticalOrderBottomNegative2() throws Exception { + final String[] expected = { + "24:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), + }; +@@ -394,7 +394,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsOrderBottom() throws Exception { ++ void staticGroupsOrderBottom() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), +@@ -403,19 +403,19 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportReception() throws Exception { ++ void importReception() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputImportOrderRepetition.java"), expected); + } + + @Test +- public void testStaticImportReceptionTop() throws Exception { ++ void staticImportReceptionTop() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputImportOrderStaticRepetition1.java"), expected); + } + + @Test +- public void testStaticImportReception() throws Exception { ++ void staticImportReception() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MSG_SEPARATION, "org.antlr.v4.runtime.CommonToken.*"), + "23:1: " + getCheckMessage(MSG_ORDERING, "java.util.Set"), +@@ -424,7 +424,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsOrderAbove() throws Exception { ++ void staticGroupsOrderAbove() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.PI"), +@@ -435,7 +435,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticOnDemandGroupsOrder() throws Exception { ++ void staticOnDemandGroupsOrder() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), + "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), +@@ -446,7 +446,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticOnDemandGroupsAlphabeticalOrder() throws Exception { ++ void staticOnDemandGroupsAlphabeticalOrder() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.antlr.v4.runtime.*"), + "24:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), +@@ -457,7 +457,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticOnDemandGroupsOrderBottom() throws Exception { ++ void staticOnDemandGroupsOrderBottom() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), +@@ -467,7 +467,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticOnDemandGroupsAlphabeticalOrderBottom() throws Exception { ++ void staticOnDemandGroupsAlphabeticalOrderBottom() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), +@@ -477,7 +477,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticOnDemandGroupsOrderAbove() throws Exception { ++ void staticOnDemandGroupsOrderAbove() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.util.Set"), + "23:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "java.lang.Math.*"), +@@ -489,7 +489,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGroupWithSlashes() throws Exception { ++ void groupWithSlashes() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); + checkConfig.addProperty("groups", "/^javax"); + +@@ -511,7 +511,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGroupWithDot() throws Exception { ++ void groupWithDot() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), + "23:1: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"), +@@ -520,7 +520,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiplePatternMatches() throws Exception { ++ void multiplePatternMatches() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.*"), + }; +@@ -536,7 +536,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + * given, so there is no other way to cover this code. + */ + @Test +- public void testVisitTokenSwitchReflection() { ++ void visitTokenSwitchReflection() { + // Create mock ast + final DetailAstImpl astImport = mockAST(TokenTypes.IMPORT, "import", 0, 0); + final DetailAstImpl astIdent = mockAST(TokenTypes.IDENT, "myTestImport", 0, 0); +@@ -577,7 +577,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEclipseDefaultPositive() throws Exception { ++ void eclipseDefaultPositive() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -585,14 +585,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticImportEclipseRepetition() throws Exception { ++ void staticImportEclipseRepetition() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputImportOrderEclipseStaticRepetition.java"), expected); + } + + @Test +- public void testEclipseDefaultNegative() throws Exception { ++ void eclipseDefaultNegative() throws Exception { + final String[] expected = { + "28:1: " + getCheckMessage(MSG_SEPARATION, "javax.swing.JComponent"), + "33:1: " + getCheckMessage(MSG_ORDERING, "org.junit.Test"), +@@ -603,14 +603,14 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUseContainerOrderingForStaticTrue() throws Exception { ++ void useContainerOrderingForStaticTrue() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputImportOrderEclipseStatic1.java"), expected); + } + + @Test +- public void testUseContainerOrderingForStaticFalse() throws Exception { ++ void useContainerOrderingForStaticFalse() throws Exception { + final String[] expected = { + "22:1: " + + getCheckMessage(MSG_ORDERING, "io.netty.handler.codec.http.HttpHeaders.Names.addDate"), +@@ -620,7 +620,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUseContainerOrderingForStaticTrueCaseSensitive() throws Exception { ++ void useContainerOrderingForStaticTrueCaseSensitive() throws Exception { + final String[] expected = { + "23:1: " + + getCheckMessage(MSG_ORDERING, "io.netty.handler.codec.http.HttpHeaders.Names.DATE"), +@@ -630,7 +630,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUseContainerOrderingForStatic() throws Exception { ++ void useContainerOrderingForStatic() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_ORDERING, "io.netty.handler.Codec.HTTP.HttpHeaders.tmp.same"), + "23:1: " + getCheckMessage(MSG_ORDERING, "io.netty.handler.Codec.HTTP.HttpHeaders.TKN.same"), +@@ -640,7 +640,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportGroupsRedundantSeparatedInternally() throws Exception { ++ void importGroupsRedundantSeparatedInternally() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "org.*"), + }; +@@ -649,7 +649,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsAbove() throws Exception { ++ void staticGroupsAbove() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -657,7 +657,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsBottom() throws Exception { ++ void staticGroupsBottom() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -665,7 +665,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsBottomSeparated() throws Exception { ++ void staticGroupsBottomSeparated() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -673,7 +673,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsInflow() throws Exception { ++ void staticGroupsInflow() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -681,7 +681,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsNegative() throws Exception { ++ void staticGroupsNegative() throws Exception { + final String[] expected = { + "21:1: " + getCheckMessage(MSG_ORDERING, "org.junit.Assert.fail"), + "23:1: " + getCheckMessage(MSG_ORDERING, "org.infinispan.test.TestingUtil.extract"), +@@ -692,7 +692,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsTop() throws Exception { ++ void staticGroupsTop() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -700,7 +700,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsTopSeparated() throws Exception { ++ void staticGroupsTopSeparated() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -708,7 +708,7 @@ public class ImportOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticGroupsUnordered() throws Exception { ++ void staticGroupsUnordered() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportControlTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportControlTest.java +index 70a13be95..0ddea39b6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportControlTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportControlTest.java +@@ -24,7 +24,7 @@ import static com.google.common.truth.Truth.assertWithMessage; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class PkgImportControlTest { ++final class PkgImportControlTest { + + private final PkgImportControl icRoot = + new PkgImportControl("com.kazgroup.courtlink", false, MismatchStrategy.DISALLOWED); +@@ -44,7 +44,7 @@ public class PkgImportControlTest { + new PkgImportControl(icRootRegexpParent, "bo+t", true, MismatchStrategy.DELEGATE_TO_PARENT); + + @BeforeEach +- public void setUp() { ++ void setUp() { + icRoot.addChild(icCommon); + icRoot.addImportRule(new PkgImportRule(false, false, "org.springframework", false, false)); + icRoot.addImportRule(new PkgImportRule(false, false, "org.hibernate", false, false)); +@@ -66,14 +66,14 @@ public class PkgImportControlTest { + } + + @Test +- public void testDotMetaCharacter() { ++ void dotMetaCharacter() { + assertWithMessage("Unexpected response") + .that(icUncommon.locateFinest("com-kazgroup.courtlink.uncommon.regexp", "MyClass")) + .isNull(); + } + + @Test +- public void testLocateFinest() { ++ void locateFinest() { + assertWithMessage("Unexpected response") + .that(icRoot.locateFinest("com.kazgroup.courtlink.domain", "MyClass")) + .isEqualTo(icRoot); +@@ -84,7 +84,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testEnsureTrailingDot() { ++ void ensureTrailingDot() { + assertWithMessage("Unexpected response") + .that(icRoot.locateFinest("com.kazgroup.courtlinkkk", "MyClass")) + .isNull(); +@@ -94,7 +94,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testCheckAccess() { ++ void checkAccess() { + assertWithMessage("Unexpected access result") + .that( + icCommon.checkAccess( +@@ -125,14 +125,14 @@ public class PkgImportControlTest { + } + + @Test +- public void testUnknownPkg() { ++ void unknownPkg() { + assertWithMessage("Unexpected response") + .that(icRoot.locateFinest("net.another", "MyClass")) + .isNull(); + } + + @Test +- public void testRegExpChildLocateFinest() { ++ void regExpChildLocateFinest() { + assertWithMessage("Unexpected response") + .that(icRootRegexpChild.locateFinest("com.kazgroup.courtlink.domain", "MyClass")) + .isEqualTo(icRootRegexpChild); +@@ -145,7 +145,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpChildCheckAccess() { ++ void regExpChildCheckAccess() { + assertWithMessage("Unexpected access result") + .that( + icCommonRegexpChild.checkAccess( +@@ -204,14 +204,14 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpChildUnknownPkg() { ++ void regExpChildUnknownPkg() { + assertWithMessage("Unexpected response") + .that(icRootRegexpChild.locateFinest("net.another", "MyClass")) + .isNull(); + } + + @Test +- public void testRegExpParentInRootIsConsidered() { ++ void regExpParentInRootIsConsidered() { + assertWithMessage("Package should not be null") + .that(icRootRegexpParent.locateFinest("com", "MyClass")) + .isNull(); +@@ -230,7 +230,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpParentInSubpackageIsConsidered() { ++ void regExpParentInSubpackageIsConsidered() { + assertWithMessage("Invalid package") + .that(icRootRegexpParent.locateFinest("com.kazgroup.courtlink.boot.api", "MyClass")) + .isEqualTo(icBootRegexpParen); +@@ -240,7 +240,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpParentEnsureTrailingDot() { ++ void regExpParentEnsureTrailingDot() { + assertWithMessage("Invalid package") + .that(icRootRegexpParent.locateFinest("com.kazgroup.courtlinkkk", "MyClass")) + .isNull(); +@@ -250,7 +250,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpParentAlternationInParentIsHandledCorrectly() { ++ void regExpParentAlternationInParentIsHandledCorrectly() { + // the regular expression has to be adjusted to (com\.foo|com\.bar) + final PkgImportControl root = + new PkgImportControl("com\\.foo|com\\.bar", true, MismatchStrategy.DISALLOWED); +@@ -272,7 +272,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpParentAlternationInParentIfUserCaresForIt() { ++ void regExpParentAlternationInParentIfUserCaresForIt() { + // the regular expression has to be adjusted to (com\.foo|com\.bar) + final PkgImportControl root = + new PkgImportControl("(com\\.foo|com\\.bar)", true, MismatchStrategy.DISALLOWED); +@@ -294,7 +294,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpParentAlternationInSubpackageIsHandledCorrectly() { ++ void regExpParentAlternationInSubpackageIsHandledCorrectly() { + final PkgImportControl root = + new PkgImportControl("org.somewhere", false, MismatchStrategy.DISALLOWED); + // the regular expression has to be adjusted to (foo|bar) +@@ -313,7 +313,7 @@ public class PkgImportControlTest { + } + + @Test +- public void testRegExpParentUnknownPkg() { ++ void regExpParentUnknownPkg() { + assertWithMessage("Package should not be null") + .that(icRootRegexpParent.locateFinest("net.another", "MyClass")) + .isNull(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportRuleTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportRuleTest.java +index b4a604f0f..fd080877c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportRuleTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/PkgImportRuleTest.java +@@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; + + import org.junit.jupiter.api.Test; + +-public class PkgImportRuleTest { ++final class PkgImportRuleTest { + + @Test +- public void testPkgImportRule() { ++ void pkgImportRule() { + final PkgImportRule rule = new PkgImportRule(true, false, "pkg", false, false); + assertWithMessage("Rule must not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -50,7 +50,7 @@ public class PkgImportRuleTest { + } + + @Test +- public void testPkgImportRuleExactMatch() { ++ void pkgImportRuleExactMatch() { + final PkgImportRule rule = new PkgImportRule(true, false, "pkg", true, false); + assertWithMessage("Rule must not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -71,7 +71,7 @@ public class PkgImportRuleTest { + } + + @Test +- public void testPkgImportRuleRegexpSimple() { ++ void pkgImportRuleRegexpSimple() { + final PkgImportRule rule = new PkgImportRule(true, false, "pkg", false, true); + assertWithMessage("Rule must not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -95,7 +95,7 @@ public class PkgImportRuleTest { + } + + @Test +- public void testPkgImportRuleExactMatchRegexpSimple() { ++ void pkgImportRuleExactMatchRegexpSimple() { + final PkgImportRule rule = new PkgImportRule(true, false, "pkg", true, true); + assertWithMessage("Rule must not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -116,7 +116,7 @@ public class PkgImportRuleTest { + } + + @Test +- public void testPkgImportRuleRegexp() { ++ void pkgImportRuleRegexp() { + final PkgImportRule rule = new PkgImportRule(true, false, "(pkg|hallo)", false, true); + assertWithMessage("Rule must not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -152,7 +152,7 @@ public class PkgImportRuleTest { + } + + @Test +- public void testPkgImportRuleNoRegexp() { ++ void pkgImportRuleNoRegexp() { + final PkgImportRule rule = new PkgImportRule(true, false, "(pkg|hallo)", false, false); + assertWithMessage("Rule must not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +@@ -185,7 +185,7 @@ public class PkgImportRuleTest { + } + + @Test +- public void testPkgImportRuleExactMatchRegexp() { ++ void pkgImportRuleExactMatchRegexp() { + final PkgImportRule rule = new PkgImportRule(true, false, "(pkg|hallo)", true, true); + assertWithMessage("Rule must not be null").that(rule).isNotNull(); + assertWithMessage("Invalid access result") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckTest.java +index 8ae80c18b..7f44cb3b9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/RedundantImportCheckTest.java +@@ -34,7 +34,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class RedundantImportCheckTest extends AbstractModuleTestSupport { ++final class RedundantImportCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,7 +42,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final RedundantImportCheck checkObj = new RedundantImportCheck(); + final int[] expected = { + TokenTypes.IMPORT, TokenTypes.STATIC_IMPORT, TokenTypes.PACKAGE_DEF, +@@ -53,7 +53,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStateIsClearedOnBeginTree1() throws Exception { ++ void stateIsClearedOnBeginTree1() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RedundantImportCheck.class); + final String inputWithWarnings = getPath("InputRedundantImportCheckClearState.java"); + final String inputWithoutWarnings = getPath("InputRedundantImportWithoutWarnings.java"); +@@ -73,7 +73,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithChecker() throws Exception { ++ void withChecker() throws Exception { + final String[] expected = { + "9:1: " + + getCheckMessage( +@@ -92,7 +92,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnnamedPackage() throws Exception { ++ void unnamedPackage() throws Exception { + final String[] expected = { + "10:1: " + getCheckMessage(MSG_DUPLICATE, 9, "java.util.List"), + "12:1: " + getCheckMessage(MSG_LANG, "java.lang.String"), +@@ -102,7 +102,7 @@ public class RedundantImportCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final RedundantImportCheck testCheckObject = new RedundantImportCheck(); + final int[] actual = testCheckObject.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java +index ff3aa9d66..db50ec153 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/imports/UnusedImportsCheckTest.java +@@ -32,7 +32,7 @@ import java.util.Arrays; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class UnusedImportsCheckTest extends AbstractModuleTestSupport { ++final class UnusedImportsCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReferencedStateIsCleared() throws Exception { ++ void referencedStateIsCleared() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(UnusedImportsCheck.class); + final String inputWithoutWarnings = getPath("InputUnusedImportsWithoutWarnings.java"); + final String inputWithWarnings = getPath("InputUnusedImportsCheckClearState.java"); +@@ -72,7 +72,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithoutProcessJavadoc() throws Exception { ++ void withoutProcessJavadoc() throws Exception { + final String[] expected = { + "11:8: " + + getCheckMessage( +@@ -111,7 +111,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessJavadoc() throws Exception { ++ void processJavadoc() throws Exception { + final String[] expected = { + "11:8: " + + getCheckMessage( +@@ -133,27 +133,27 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProcessJavadocWithLinkTag() throws Exception { ++ void processJavadocWithLinkTag() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputUnusedImportsWithValueTag.java"), expected); + } + + @Test +- public void testProcessJavadocWithBlockTagContainingMethodParameters() throws Exception { ++ void processJavadocWithBlockTagContainingMethodParameters() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputUnusedImportsWithBlockMethodParameters.java"), expected); + } + + @Test +- public void testAnnotations() throws Exception { ++ void annotations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputUnusedImportsAnnotations.java"), expected); + } + + @Test +- public void testArrayRef() throws Exception { ++ void arrayRef() throws Exception { + final String[] expected = { + "13:8: " + getCheckMessage(MSG_KEY, "java.util.ArrayList"), + }; +@@ -161,20 +161,20 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBug() throws Exception { ++ void bug() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputUnusedImportsBug.java"), expected); + } + + @Test +- public void testNewlinesInsideTags() throws Exception { ++ void newlinesInsideTags() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputUnusedImportsWithNewlinesInsideTags.java"), expected); + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final UnusedImportsCheck testCheckObject = new UnusedImportsCheck(); + final int[] actual = testCheckObject.getRequiredTokens(); + final int[] expected = { +@@ -202,7 +202,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final UnusedImportsCheck testCheckObject = new UnusedImportsCheck(); + final int[] actual = testCheckObject.getAcceptableTokens(); + final int[] expected = { +@@ -230,7 +230,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFileInUnnamedPackage() throws Exception { ++ void fileInUnnamedPackage() throws Exception { + final String[] expected = { + "12:8: " + getCheckMessage(MSG_KEY, "java.util.Arrays"), + "13:8: " + getCheckMessage(MSG_KEY, "java.lang.String"), +@@ -240,7 +240,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportsFromJavaLang() throws Exception { ++ void importsFromJavaLang() throws Exception { + final String[] expected = { + "10:8: " + getCheckMessage(MSG_KEY, "java.lang.String"), + "11:8: " + getCheckMessage(MSG_KEY, "java.lang.Math"), +@@ -258,7 +258,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportsJavadocQualifiedName() throws Exception { ++ void importsJavadocQualifiedName() throws Exception { + final String[] expected = { + "11:8: " + getCheckMessage(MSG_KEY, "java.util.List"), + }; +@@ -266,7 +266,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleWordPackage() throws Exception { ++ void singleWordPackage() throws Exception { + final String[] expected = { + "10:8: " + getCheckMessage(MSG_KEY, "module"), + }; +@@ -275,7 +275,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsAndCompactCtors() throws Exception { ++ void recordsAndCompactCtors() throws Exception { + final String[] expected = { + "19:8: " + getCheckMessage(MSG_KEY, "javax.swing.JToolBar"), + "20:8: " + getCheckMessage(MSG_KEY, "javax.swing.JToggleButton"), +@@ -285,7 +285,7 @@ public class UnusedImportsCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShadowedImports() throws Exception { ++ void shadowedImports() throws Exception { + final String[] expected = { + "12:8: " + getCheckMessage(MSG_KEY, "java.util.Map"), + "13:8: " + getCheckMessage(MSG_KEY, "java.util.Set"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckTest.java +index db6f409f1..d88a4a229 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/CommentsIndentationCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { ++final class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsAtTheEndOfBlock() throws Exception { ++ void commentIsAtTheEndOfBlock() throws Exception { + final String[] expected = { + "25:26: " + getCheckMessage(MSG_KEY_SINGLE, 24, 25, 8), + "40:6: " + getCheckMessage(MSG_KEY_SINGLE, 42, 5, 4), +@@ -92,7 +92,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsInsideSwitchBlock() throws Exception { ++ void commentIsInsideSwitchBlock() throws Exception { + final String[] expected = { + "27:13: " + getCheckMessage(MSG_KEY_BLOCK, 28, 12, 16), + "33:20: " + getCheckMessage(MSG_KEY_SINGLE, "32, 34", 19, "16, 12"), +@@ -120,7 +120,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIsInsideEmptyBlock() throws Exception { ++ void commentIsInsideEmptyBlock() throws Exception { + final String[] expected = { + "16:20: " + getCheckMessage(MSG_KEY_SINGLE, 19, 19, 31), + "17:24: " + getCheckMessage(MSG_KEY_BLOCK, 19, 23, 31), +@@ -135,7 +135,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSurroundingCode() throws Exception { ++ void surroundingCode() throws Exception { + final String[] expected = { + "20:15: " + getCheckMessage(MSG_KEY_SINGLE, 21, 14, 12), + "31:17: " + getCheckMessage(MSG_KEY_BLOCK, 32, 16, 12), +@@ -155,14 +155,14 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoNpeWhenBlockCommentEndsClassFile() throws Exception { ++ void noNpeWhenBlockCommentEndsClassFile() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + final String testInputFile = "InputCommentsIndentationNoNpe.java"; + verifyWithInlineConfigParser(getPath(testInputFile), expected); + } + + @Test +- public void testCheckOnlySingleLineComments() throws Exception { ++ void checkOnlySingleLineComments() throws Exception { + final String[] expected = { + "20:15: " + getCheckMessage(MSG_KEY_SINGLE, 21, 14, 12), + "57:28: " + getCheckMessage(MSG_KEY_SINGLE, 60, 27, 36), +@@ -175,7 +175,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckOnlyBlockComments() throws Exception { ++ void checkOnlyBlockComments() throws Exception { + final String[] expected = { + "30:17: " + getCheckMessage(MSG_KEY_BLOCK, 31, 16, 12), + "32:17: " + getCheckMessage(MSG_KEY_BLOCK, 34, 16, 12), +@@ -190,7 +190,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitToken() { ++ void visitToken() { + final CommentsIndentationCheck check = new CommentsIndentationCheck(); + final DetailAstImpl methodDef = new DetailAstImpl(); + methodDef.setType(TokenTypes.METHOD_DEF); +@@ -207,7 +207,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadoc() throws Exception { ++ void javadoc() throws Exception { + final String[] expected = { + "10:3: " + getCheckMessage(MSG_KEY_BLOCK, 13, 2, 0), + "16:1: " + getCheckMessage(MSG_KEY_BLOCK, 17, 0, 4), +@@ -219,7 +219,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultiblockStructures() throws Exception { ++ void multiblockStructures() throws Exception { + final String[] expected = { + "19:9: " + getCheckMessage(MSG_KEY_SINGLE, 18, 8, 12), + "25:17: " + getCheckMessage(MSG_KEY_SINGLE, "24, 26", 16, "12, 8"), +@@ -245,7 +245,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentsAfterAnnotation() throws Exception { ++ void commentsAfterAnnotation() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_KEY_SINGLE, 22, 4, 0), + "25:9: " + getCheckMessage(MSG_KEY_SINGLE, 26, 8, 4), +@@ -258,7 +258,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentsInSameMethodCallWithSameIndent() throws Exception { ++ void commentsInSameMethodCallWithSameIndent() throws Exception { + final String[] expected = { + "23:7: " + getCheckMessage(MSG_KEY_SINGLE, 24, 6, 4), + "30:11: " + getCheckMessage(MSG_KEY_SINGLE, 31, 10, 4), +@@ -268,7 +268,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentIndentationWithEmoji() throws Exception { ++ void commentIndentationWithEmoji() throws Exception { + final String[] expected = { + "14:9: " + getCheckMessage(MSG_KEY_SINGLE, 15, 8, 16), + "25:13: " + getCheckMessage(MSG_KEY_SINGLE, 24, 12, 8), +@@ -285,7 +285,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentsBlockCommentBeforePackage() throws Exception { ++ void commentsBlockCommentBeforePackage() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_KEY_BLOCK, 11, 0, 1), + }; +@@ -294,7 +294,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentsAfterRecordsAndCompactCtors() throws Exception { ++ void commentsAfterRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "15:17: " + getCheckMessage(MSG_KEY_SINGLE, 16, 16, 20), + "28:1: " + getCheckMessage(MSG_KEY_SINGLE, 29, 0, 4), +@@ -307,7 +307,7 @@ public class CommentsIndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentsAtTheEndOfMethodCall() throws Exception { ++ void commentsAtTheEndOfMethodCall() throws Exception { + final String[] expected = { + "24:16: " + getCheckMessage(MSG_KEY_SINGLE, 20, 15, 8), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java +index f6ebfbe27..bf379d30c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/indentation/IndentationCheckTest.java +@@ -19,11 +19,13 @@ + + package com.puppycrawl.tools.checkstyle.checks.indentation; + ++import static com.google.common.base.Preconditions.checkState; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.MSG_CHILD_ERROR; + import static com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.MSG_CHILD_ERROR_MULTI; + import static com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.MSG_ERROR; + import static com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck.MSG_ERROR_MULTI; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.Checker; +@@ -34,7 +36,6 @@ import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.BufferedReader; + import java.io.IOException; +-import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.nio.file.Paths; + import java.util.ArrayList; +@@ -46,7 +47,7 @@ import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; + + /** Unit test for IndentationCheck. */ +-public class IndentationCheckTest extends AbstractModuleTestSupport { ++final class IndentationCheckTest extends AbstractModuleTestSupport { + + private static final Pattern LINE_WITH_COMMENT_REGEX = + Pattern.compile( +@@ -57,8 +58,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + private static IndentComment[] getLinesWithWarnAndCheckComments( + String aFileName, final int tabWidth) throws IOException { + final List result = new ArrayList<>(); +- try (BufferedReader br = +- Files.newBufferedReader(Paths.get(aFileName), StandardCharsets.UTF_8)) { ++ try (BufferedReader br = Files.newBufferedReader(Paths.get(aFileName), UTF_8)) { + int lineNumber = 1; + for (String line = br.readLine(); line != null; line = br.readLine()) { + final Matcher match = LINE_WITH_COMMENT_REGEX.matcher(line); +@@ -66,26 +66,24 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + final IndentComment warn = new IndentComment(match, lineNumber); + final int actualIndent = getLineStart(line, tabWidth); + +- if (actualIndent != warn.getIndent()) { +- throw new IllegalStateException( +- String.format( +- Locale.ROOT, +- "File \"%1$s\" has incorrect indentation in comment. " +- + "Line %2$d: comment:%3$d, actual:%4$d.", +- aFileName, +- lineNumber, +- warn.getIndent(), +- actualIndent)); +- } ++ checkState( ++ actualIndent == warn.getIndent(), ++ String.format( ++ Locale.ROOT, ++ "File \"%1$s\" has incorrect indentation in comment. " ++ + "Line %2$d: comment:%3$d, actual:%4$d.", ++ aFileName, ++ lineNumber, ++ warn.getIndent(), ++ actualIndent)); + +- if (!isCommentConsistent(warn)) { +- throw new IllegalStateException( +- String.format( +- Locale.ROOT, +- "File \"%1$s\" has inconsistent comment on line %2$d", +- aFileName, +- lineNumber)); +- } ++ checkState( ++ isCommentConsistent(warn), ++ String.format( ++ Locale.ROOT, ++ "File \"%1$s\" has inconsistent comment on line %2$d", ++ aFileName, ++ lineNumber)); + + if (warn.isWarning()) { + result.add(warn); +@@ -169,7 +167,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final IndentationCheck checkObj = new IndentationCheck(); + final int[] requiredTokens = checkObj.getRequiredTokens(); + final HandlerFactory handlerFactory = new HandlerFactory(); +@@ -182,7 +180,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final IndentationCheck checkObj = new IndentationCheck(); + final int[] acceptableTokens = checkObj.getAcceptableTokens(); + final HandlerFactory handlerFactory = new HandlerFactory(); +@@ -195,7 +193,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThrowsIndentProperty() { ++ void throwsIndentProperty() { + final IndentationCheck indentationCheck = new IndentationCheck(); + + indentationCheck.setThrowsIndent(1); +@@ -206,7 +204,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictCondition() throws Exception { ++ void strictCondition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("arrayInitIndent", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -225,7 +223,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void forbidOldStyle() throws Exception { ++ void forbidOldStyle() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("arrayInitIndent", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -243,7 +241,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testZeroCaseLevel() throws Exception { ++ void zeroCaseLevel() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("arrayInitIndent", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -258,7 +256,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAndroidStyle() throws Exception { ++ void androidStyle() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("arrayInitIndent", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -283,7 +281,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodCallLineWrap() throws Exception { ++ void methodCallLineWrap() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -303,7 +301,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDifficultAnnotations() throws Exception { ++ void difficultAnnotations() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -329,7 +327,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationClosingParenthesisEndsInSameIndentationAsOpening() throws Exception { ++ void annotationClosingParenthesisEndsInSameIndentationAsOpening() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("basicOffset", "4"); +@@ -352,7 +350,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnonClassesFromGuava() throws Exception { ++ void anonClassesFromGuava() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -368,7 +366,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotations() throws Exception { ++ void annotations() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -384,7 +382,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCorrectIfAndParameters() throws Exception { ++ void correctIfAndParameters() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -407,7 +405,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnonymousClasses() throws Exception { ++ void anonymousClasses() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -423,7 +421,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrays() throws Exception { ++ void arrays() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "2"); +@@ -439,7 +437,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLabels() throws Exception { ++ void labels() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -455,7 +453,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassesAndMethods() throws Exception { ++ void classesAndMethods() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -471,7 +469,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCtorCall() throws Exception { ++ void ctorCall() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("basicOffset", "2"); +@@ -504,7 +502,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMembers() throws Exception { ++ void members() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -524,7 +522,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationArrayInit() throws Exception { ++ void annotationArrayInit() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "6"); +@@ -560,7 +558,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationArrayInitTwo() throws Exception { ++ void annotationArrayInitTwo() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "0"); +@@ -588,7 +586,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationArrayInitWithEmoji() throws Exception { ++ void annotationArrayInitWithEmoji() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "0"); +@@ -626,7 +624,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOddAnnotations() throws Exception { ++ void oddAnnotations() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "3"); +@@ -648,7 +646,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationOddStyles() throws Exception { ++ void annotationOddStyles() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("tabWidth", "8"); +@@ -661,7 +659,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testZeroAnnotationArrayInit() throws Exception { ++ void zeroAnnotationArrayInit() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "0"); +@@ -683,7 +681,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationArrayInitGoodCase() throws Exception { ++ void annotationArrayInitGoodCase() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -700,7 +698,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationArrayInitGoodCaseTwo() throws Exception { ++ void annotationArrayInitGoodCaseTwo() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -717,7 +715,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidLabel() throws Exception { ++ void invalidLabel() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -740,7 +738,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidLabelWithWhileLoop() throws Exception { ++ void invalidLabelWithWhileLoop() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -760,7 +758,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidLabel() throws Exception { ++ void validLabel() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -776,7 +774,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidIfWithChecker() throws Exception { ++ void validIfWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -795,7 +793,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidDotWithChecker() throws Exception { ++ void validDotWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -812,7 +810,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidMethodWithChecker() throws Exception { ++ void validMethodWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -832,7 +830,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidMethodWithChecker() throws Exception { ++ void invalidMethodWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -885,7 +883,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAlternativeGoogleStyleSwitchCaseAndEnums() throws Exception { ++ void alternativeGoogleStyleSwitchCaseAndEnums() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -908,7 +906,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidSwitchWithChecker() throws Exception { ++ void invalidSwitchWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -955,7 +953,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIfElseWithNoCurly() throws Exception { ++ void ifElseWithNoCurly() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -979,7 +977,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhileWithNoCurly() throws Exception { ++ void whileWithNoCurly() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1002,7 +1000,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForWithNoCurly() throws Exception { ++ void forWithNoCurly() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1026,7 +1024,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDoWhileWithoutCurly() throws Exception { ++ void doWhileWithoutCurly() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1047,7 +1045,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidSwitchWithChecker() throws Exception { ++ void validSwitchWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1064,7 +1062,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewKeyword() throws Exception { ++ void newKeyword() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("basicOffset", "4"); +@@ -1077,7 +1075,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewKeyword2() throws Exception { ++ void newKeyword2() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("basicOffset", "4"); +@@ -1090,7 +1088,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidNewKeywordWithForceStrictCondition() throws Exception { ++ void validNewKeywordWithForceStrictCondition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("basicOffset", "4"); +@@ -1103,7 +1101,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidNewKeywordWithForceStrictCondition() throws Exception { ++ void invalidNewKeywordWithForceStrictCondition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("basicOffset", "4"); +@@ -1120,7 +1118,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidArrayInitDefaultIndentWithChecker() throws Exception { ++ void validArrayInitDefaultIndentWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1137,7 +1135,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidArrayInitWithChecker() throws Exception { ++ void validArrayInitWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "8"); +@@ -1154,7 +1152,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidArrayInitTwoDimensional() throws Exception { ++ void validArrayInitTwoDimensional() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "2"); +@@ -1171,7 +1169,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidArrayInitTwoDimensional() throws Exception { ++ void invalidArrayInitTwoDimensional() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "2"); +@@ -1201,7 +1199,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidArrayInit() throws Exception { ++ void validArrayInit() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "2"); +@@ -1218,7 +1216,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidArrayInitWithChecker() throws Exception { ++ void invalidArrayInitWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1280,7 +1278,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayInitWithEmoji() throws Exception { ++ void arrayInitWithEmoji() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "2"); +@@ -1304,7 +1302,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testChainedMethodCalling() throws Exception { ++ void chainedMethodCalling() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "2"); +@@ -1326,7 +1324,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidArrayInitWithTrueStrictCondition() throws Exception { ++ void invalidArrayInitWithTrueStrictCondition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1388,7 +1386,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidTryWithChecker() throws Exception { ++ void validTryWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1405,7 +1403,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidTryWithChecker() throws Exception { ++ void invalidTryWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1451,7 +1449,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidClassDefWithChecker() throws Exception { ++ void invalidClassDefWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1503,7 +1501,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidBlockWithChecker() throws Exception { ++ void invalidBlockWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1567,7 +1565,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidIfWithChecker() throws Exception { ++ void invalidIfWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1659,7 +1657,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidWhileWithChecker() throws Exception { ++ void invalidWhileWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1705,7 +1703,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidInvalidAnonymousClass() throws Exception { ++ void invalidInvalidAnonymousClass() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1722,7 +1720,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidForWithChecker() throws Exception { ++ void invalidForWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1770,7 +1768,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidForWithChecker() throws Exception { ++ void validForWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1787,7 +1785,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidDoWhileWithChecker() throws Exception { ++ void validDoWhileWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1804,7 +1802,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidDoWhileWithChecker() throws Exception { ++ void invalidDoWhileWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1839,7 +1837,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidBlockWithChecker() throws Exception { ++ void validBlockWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1856,7 +1854,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidWhileWithChecker() throws Exception { ++ void validWhileWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1873,7 +1871,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidClassDefWithChecker() throws Exception { ++ void validClassDefWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1893,7 +1891,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidInterfaceDefWithChecker() throws Exception { ++ void validInterfaceDefWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1910,7 +1908,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidCommaWithChecker() throws Exception { ++ void validCommaWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1927,7 +1925,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTabs() throws Exception { ++ void tabs() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1945,7 +1943,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationLevel() throws Exception { ++ void indentationLevel() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1963,7 +1961,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThrowsIndentationLevel() throws Exception { ++ void throwsIndentationLevel() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -1979,7 +1977,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThrowsIndentationLevel2() throws Exception { ++ void throwsIndentationLevel2() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("basicOffset", "1"); +@@ -2006,7 +2004,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseLevel() throws Exception { ++ void caseLevel() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2024,7 +2022,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBraceAdjustment() throws Exception { ++ void braceAdjustment() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2046,7 +2044,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidAssignWithChecker() throws Exception { ++ void invalidAssignWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2067,7 +2065,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidImportIndent() throws Exception { ++ void invalidImportIndent() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("basicOffset", "8"); + checkConfig.addProperty("tabWidth", "4"); +@@ -2079,7 +2077,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testValidAssignWithChecker() throws Exception { ++ void validAssignWithChecker() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2095,7 +2093,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test15Extensions() throws Exception { ++ void test15Extensions() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2111,7 +2109,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryResources() throws Exception { ++ void tryResources() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2127,7 +2125,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCustom() throws Exception { ++ void switchCustom() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2143,7 +2141,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSynchronizedStatement() throws Exception { ++ void synchronizedStatement() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("arrayInitIndent", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2161,7 +2159,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSynchronizedMethod() throws Exception { ++ void synchronizedMethod() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("arrayInitIndent", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2176,7 +2174,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnonymousClassInMethod() throws Exception { ++ void anonymousClassInMethod() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "8"); + checkConfig.addProperty("basicOffset", "2"); +@@ -2197,7 +2195,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnonymousClassInMethodWithCurlyOnNewLine() throws Exception { ++ void anonymousClassInMethodWithCurlyOnNewLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2222,7 +2220,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationDefinition() throws Exception { ++ void annotationDefinition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -2230,7 +2228,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageDeclaration() throws Exception { ++ void packageDeclaration() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2240,7 +2238,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageDeclaration2() throws Exception { ++ void packageDeclaration2() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2250,7 +2248,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageDeclaration3() throws Exception { ++ void packageDeclaration3() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -2258,7 +2256,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageDeclaration4() throws Exception { ++ void packageDeclaration4() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2269,7 +2267,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambda1() throws Exception { ++ void lambda1() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "2"); + checkConfig.addProperty("basicOffset", "2"); +@@ -2289,7 +2287,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambda2() throws Exception { ++ void lambda2() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2299,7 +2297,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambda3() throws Exception { ++ void lambda3() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2316,7 +2314,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambda4() throws Exception { ++ void lambda4() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2326,7 +2324,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambda5() throws Exception { ++ void lambda5() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "3"); + checkConfig.addProperty("basicOffset", "3"); +@@ -2337,7 +2335,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaFalseForceStrictCondition() throws Exception { ++ void lambdaFalseForceStrictCondition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2356,7 +2354,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaTrueForceStrictCondition() throws Exception { ++ void lambdaTrueForceStrictCondition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2385,7 +2383,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaOddConditions() throws Exception { ++ void lambdaOddConditions() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "3"); +@@ -2398,7 +2396,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSeparatedStatements() throws Exception { ++ void separatedStatements() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String fileName = getPath("InputIndentationSeparatedStatements.java"); +@@ -2407,7 +2405,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSeparatedLineWithJustSpaces() throws Exception { ++ void separatedLineWithJustSpaces() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String fileName = getPath("InputIndentationSeparatedStatementWithSpaces.java"); +@@ -2416,7 +2414,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTwoStatementsPerLine() throws Exception { ++ void twoStatementsPerLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2426,7 +2424,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodChaining() throws Exception { ++ void methodChaining() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2436,7 +2434,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleAnnotationsWithWrappedLines() throws Exception { ++ void multipleAnnotationsWithWrappedLines() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2448,7 +2446,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodPrecedeByAnnotationsWithParameterOnSeparateLine() throws Exception { ++ void methodPrecedeByAnnotationsWithParameterOnSeparateLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "2"); +@@ -2464,7 +2462,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationIncorrect() throws Exception { ++ void annotationIncorrect() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2480,7 +2478,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputAnnotationScopeIndentationCheck() throws Exception { ++ void inputAnnotationScopeIndentationCheck() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2494,7 +2492,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInputAnnotationDefIndentationCheck() throws Exception { ++ void inputAnnotationDefIndentationCheck() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("arrayInitIndent", "4"); +@@ -2539,7 +2537,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryResourcesStrict() throws Exception { ++ void tryResourcesStrict() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("forceStrictCondition", "true"); +@@ -2574,7 +2572,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryResourcesNotStrict() throws Exception { ++ void tryResourcesNotStrict() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("braceAdjustment", "0"); +@@ -2613,7 +2611,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + * @see IndentComment#getExpectedMessagePostfix(String) + */ + @Test +- public void testArgumentOrderOfErrorMessages() { ++ void argumentOrderOfErrorMessages() { + final Object[] arguments = {"##0##", "##1##", "##2##"}; + final String[] messages = { + getCheckMessage(MSG_ERROR, arguments), +@@ -2640,7 +2638,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyArray() throws Exception { ++ void emptyArray() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -2648,7 +2646,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewHandler() throws Exception { ++ void newHandler() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2661,7 +2659,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryHandler() throws Exception { ++ void tryHandler() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("braceAdjustment", "0"); +@@ -2672,7 +2670,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryHandler2() throws Exception { ++ void tryHandler2() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("braceAdjustment", "0"); +@@ -2686,7 +2684,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testChainedMethodWithBracketOnNewLine() throws Exception { ++ void chainedMethodWithBracketOnNewLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + + checkConfig.addProperty("arrayInitIndent", "2"); +@@ -2710,7 +2708,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationSwitchExpression() throws Exception { ++ void indentationSwitchExpression() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2734,7 +2732,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationYieldStatement() throws Exception { ++ void indentationYieldStatement() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2750,7 +2748,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationSwitchExpressionCorrect() throws Exception { ++ void indentationSwitchExpressionCorrect() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -2761,7 +2759,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationSwitchExpressionDeclaration() throws Exception { ++ void indentationSwitchExpressionDeclaration() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("caseIndent", "4"); +@@ -2783,7 +2781,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationRecords() throws Exception { ++ void indentationRecords() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2800,7 +2798,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationRecordsAndCompactCtors() throws Exception { ++ void indentationRecordsAndCompactCtors() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2817,7 +2815,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationSwitchExpressionNewLine() throws Exception { ++ void indentationSwitchExpressionNewLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2832,7 +2830,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationMethodParenthesisOnNewLine() throws Exception { ++ void indentationMethodParenthesisOnNewLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2844,7 +2842,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationMethodParenthesisOnNewLine1() throws Exception { ++ void indentationMethodParenthesisOnNewLine1() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + final String[] expected = { +@@ -2857,7 +2855,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationLineWrappedRecordDeclaration() throws Exception { ++ void indentationLineWrappedRecordDeclaration() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2896,7 +2894,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationAnnotationFieldDefinition() throws Exception { ++ void indentationAnnotationFieldDefinition() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + checkConfig.addProperty("basicOffset", "4"); +@@ -2916,7 +2914,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationLongConcatenatedString() throws Exception { ++ void indentationLongConcatenatedString() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + +@@ -2926,7 +2924,7 @@ public class IndentationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIndentationLineBreakVariableDeclaration() throws Exception { ++ void indentationLineBreakVariableDeclaration() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(IndentationCheck.class); + checkConfig.addProperty("tabWidth", "4"); + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java +index c90259710..c96dedc65 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AbstractJavadocCheckTest.java +@@ -26,9 +26,9 @@ import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocChec + import static com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck.MSG_JAVADOC_WRONG_SINGLETON_TAG; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck.MSG_SUMMARY_FIRST_SENTENCE; + import static java.util.Arrays.asList; +-import static java.util.Collections.singletonList; +-import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; ++import static org.assertj.core.api.Assertions.assertThatCode; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.api.DetailNode; +@@ -48,7 +48,7 @@ import org.junit.jupiter.api.extension.ExtendWith; + import org.junit.jupiter.api.io.TempDir; + + @ExtendWith(SystemErrGuard.class) +-public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { ++final class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + + @TempDir public File temporaryFolder; + +@@ -67,12 +67,12 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + * @param systemErr wrapper for {@code System.err} + */ + @BeforeEach +- public void setUp(@SysErr Capturable systemErr) { ++ void setUp(@SysErr Capturable systemErr) { + systemErr.captureMuted(); + } + + @Test +- public void testJavadocTagsWithoutArgs() throws Exception { ++ void javadocTagsWithoutArgs() throws Exception { + final DefaultConfiguration checkconfig = createModuleConfig(TempCheck.class); + final String[] expected = { + "9: " +@@ -137,7 +137,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNumberFormatException() throws Exception { ++ void numberFormatException() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final String[] expected = { + "7: " +@@ -151,14 +151,14 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomTag() throws Exception { ++ void customTag() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputAbstractJavadocCustomTag.java"), expected); + } + + @Test +- public void testParsingErrors(@SysErr Capturable systemErr) throws Exception { ++ void parsingErrors(@SysErr Capturable systemErr) throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final String[] expected = { + "8: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), +@@ -169,13 +169,13 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithMultipleChecks() throws Exception { ++ void withMultipleChecks() throws Exception { + verifyWithInlineConfigParser( + getPath("InputAbstractJavadocCorrectParagraph.java"), CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testAntlrError(@SysErr Capturable systemErr) throws Exception { ++ void antlrError(@SysErr Capturable systemErr) throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final String[] expected = { + "8: " +@@ -187,8 +187,8 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckReuseAfterParseErrorWithFollowingAntlrErrorInTwoFiles( +- @SysErr Capturable systemErr) throws Exception { ++ void checkReuseAfterParseErrorWithFollowingAntlrErrorInTwoFiles(@SysErr Capturable systemErr) ++ throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final Map> expectedMessages = new LinkedHashMap<>(2); + expectedMessages.put( +@@ -198,7 +198,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + "12: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 35, "img"))); + expectedMessages.put( + getPath("InputAbstractJavadocInvalidAtSeeReference2.java"), +- singletonList( ++ ImmutableList.of( + "8: " + + getCheckMessage( + MSG_JAVADOC_PARSE_RULE_ERROR, +@@ -216,7 +216,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckReuseAfterParseErrorWithFollowingAntlrErrorInSingleFile() throws Exception { ++ void checkReuseAfterParseErrorWithFollowingAntlrErrorInSingleFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final String[] expected = { + "8: " + getCheckMessage(MSG_JAVADOC_MISSED_HTML_CLOSE, 4, "unclosedTag"), +@@ -231,7 +231,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPosition() throws Exception { ++ void position() throws Exception { + JavadocCatchCheck.clearCounter(); + final DefaultConfiguration checkConfig = createModuleConfig(JavadocCatchCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -242,7 +242,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPositionWithSinglelineComments() throws Exception { ++ void positionWithSinglelineComments() throws Exception { + JavadocCatchCheck.clearCounter(); + final DefaultConfiguration checkConfig = createModuleConfig(JavadocCatchCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -254,7 +254,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPositionOnlyComments() throws Exception { ++ void positionOnlyComments() throws Exception { + JavadocCatchCheck.clearCounter(); + final DefaultConfiguration checkConfig = createModuleConfig(JavadocCatchCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -265,7 +265,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokens() { ++ void tokens() { + final int[] defaultJavadocTokens = {JavadocTokenTypes.JAVADOC}; + final AbstractJavadocCheck check = + new AbstractJavadocCheck() { +@@ -301,7 +301,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokensFail() { ++ void tokensFail() { + final int[] defaultJavadocTokens = { + JavadocTokenTypes.JAVADOC, + JavadocTokenTypes.AREA_HTML_TAG_NAME, +@@ -323,11 +323,11 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + }; + check.setJavadocTokens("RETURN_LITERAL"); +- assertDoesNotThrow(check::init); ++ assertThatCode(check::init).doesNotThrowAnyException(); + } + + @Test +- public void testAcceptableTokensFail() throws Exception { ++ void acceptableTokensFail() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(TokenIsNotInAcceptablesJavadocCheck.class); + checkConfig.addProperty("javadocTokens", "RETURN_LITERAL"); +@@ -349,7 +349,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptableTokensPass() throws Exception { ++ void acceptableTokensPass() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(TokenIsNotInAcceptablesJavadocCheck.class); + checkConfig.addProperty("javadocTokens", "DEPRECATED_LITERAL"); +@@ -359,7 +359,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredTokenIsNotInDefaultTokens() throws Exception { ++ void requiredTokenIsNotInDefaultTokens() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(RequiredTokenIsNotInDefaultsJavadocCheck.class); + final String pathToEmptyFile = File.createTempFile("empty", ".java", temporaryFolder).getPath(); +@@ -381,7 +381,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitLeaveToken() throws Exception { ++ void visitLeaveToken() throws Exception { + JavadocVisitLeaveCheck.clearCounter(); + final DefaultConfiguration checkConfig = createModuleConfig(JavadocVisitLeaveCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -395,7 +395,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoWsBeforeDescriptionInJavadocTags() throws Exception { ++ void noWsBeforeDescriptionInJavadocTags() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final String[] expected = { + "17: " +@@ -448,7 +448,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongSingletonTagInJavadoc() throws Exception { ++ void wrongSingletonTagInJavadoc() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(TempCheck.class); + final String[] expected = { + "9: " + getCheckMessage(MSG_JAVADOC_WRONG_SINGLETON_TAG, 9, "embed"), +@@ -461,7 +461,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonTightHtmlTagIntolerantCheck() throws Exception { ++ void nonTightHtmlTagIntolerantCheck() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(NonTightHtmlTagIntolerantCheck.class); + checkConfig.addProperty("violateExecutionOnNonTightHtml", "true"); +@@ -481,7 +481,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonTightHtmlTagIntolerantCheckReportingNoViolation() throws Exception { ++ void nonTightHtmlTagIntolerantCheckReportingNoViolation() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(NonTightHtmlTagIntolerantCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -489,7 +489,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonTightHtmlTagIntolerantCheckVisitCount() throws Exception { ++ void nonTightHtmlTagIntolerantCheckVisitCount() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(NonTightHtmlTagIntolerantCheck.class); + checkConfig.addProperty("violateExecutionOnNonTightHtml", "true"); +@@ -515,7 +515,7 @@ public class AbstractJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitCountForCheckAcceptingJavadocWithNonTightHtml() throws Exception { ++ void visitCountForCheckAcceptingJavadocWithNonTightHtml() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(NonTightHtmlTagTolerantCheck.class); + checkConfig.addProperty("violateExecutionOnNonTightHtml", "true"); + checkConfig.addProperty("reportVisitJavadocToken", "true"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java +index 18f0ee85e..c9fa841da 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/AtclauseOrderCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { ++final class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AtclauseOrderCheck checkObj = new AtclauseOrderCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -44,7 +44,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AtclauseOrderCheck checkObj = new AtclauseOrderCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -53,14 +53,14 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputAtclauseOrderCorrect.java"), expected); + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String tagOrder = + "[@author, @version, @param, @return, @throws, @exception, @see," + + " @since, @serial, @serialField, @serialData, @deprecated]"; +@@ -110,7 +110,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrectCustom() throws Exception { ++ void incorrectCustom() throws Exception { + final String tagOrder = + "[@since, @version, @param, @return, @throws, @exception," + + " @deprecated, @see, @serial, @serialField, @serialData, @author]"; +@@ -121,14 +121,14 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfo() throws Exception { ++ void packageInfo() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("package-info.java"), expected); + } + + @Test +- public void testAtclauseOrderRecords() throws Exception { ++ void atclauseOrderRecords() throws Exception { + final String tagOrder = + "[@author, @version, @param, @return, @throws, @exception," + + " @see, @since, @serial, @serialField, @serialData, @deprecated]"; +@@ -147,7 +147,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodReturningArrayType() throws Exception { ++ void methodReturningArrayType() throws Exception { + final String tagOrder = + "[@author, @version, @param, @return, @throws, @exception, @see," + + " @since, @serial, @serialField, @serialData, @deprecated]"; +@@ -161,7 +161,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAtclauseOrderLotsOfRecords() throws Exception { ++ void atclauseOrderLotsOfRecords() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -169,7 +169,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAtclause() throws Exception { ++ void atclause() throws Exception { + final String tagOrder = + "[@author, @version, @param, @return, @throws, @exception, @see," + + " @since, @serial, @serialField, @serialData, @deprecated]"; +@@ -202,7 +202,7 @@ public class AtclauseOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNewArrayDeclaratorStructure() throws Exception { ++ void newArrayDeclaratorStructure() throws Exception { + final String tagOrder = + "[@author, @version, @param, @return, @throws, @exception, @see," + + " @since, @serial, @serialField, @serialData, @deprecated]"; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocPositionCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocPositionCheckTest.java +index 1d68f72c4..312700cad 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocPositionCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/InvalidJavadocPositionCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { ++final class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final int[] expected = { + TokenTypes.BLOCK_COMMENT_BEGIN, + }; +@@ -45,7 +45,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final int[] expected = { + TokenTypes.BLOCK_COMMENT_BEGIN, + }; +@@ -56,7 +56,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "7:9: " + getCheckMessage(MSG_KEY), + "10:1: " + getCheckMessage(MSG_KEY), +@@ -89,7 +89,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfo() throws Exception { ++ void packageInfo() throws Exception { + final String[] expected = { + "7:1: " + getCheckMessage(MSG_KEY), + }; +@@ -97,7 +97,7 @@ public class InvalidJavadocPositionCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfoComment() throws Exception { ++ void packageInfoComment() throws Exception { + final String[] expected = { + "7:1: " + getCheckMessage(MSG_KEY), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheckTest.java +index 57fbd9b23..15168836d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocBlockTagLocationCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport { ++final class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocBlockTagLocationCheck checkObj = new JavadocBlockTagLocationCheck(); + final int[] expected = { + JavadocTokenTypes.TEXT, +@@ -46,7 +46,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocBlockTagLocationCorrect.java"), expected); +@@ -61,7 +61,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport + * @throws Exception if exception occurs during verification process. + */ + @Test +- public void testMultilineCodeBlock() throws Exception { ++ void multilineCodeBlock() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -69,7 +69,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_BLOCK_TAG_LOCATION, "author"), + "16: " + getCheckMessage(MSG_BLOCK_TAG_LOCATION, "since"), +@@ -83,7 +83,7 @@ public class JavadocBlockTagLocationCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testCustomTags() throws Exception { ++ void customTags() throws Exception { + final String[] expected = { + "14: " + getCheckMessage(MSG_BLOCK_TAG_LOCATION, "apiNote"), + "14: " + getCheckMessage(MSG_BLOCK_TAG_LOCATION, "implNote"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckTest.java +index d26e16973..bd0df925f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocContentLocationCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { ++final class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocContentLocationCheck checkObj = new JavadocContentLocationCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Acceptable tokens are invalid") +@@ -45,7 +45,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetDefaultTokens() { ++ void getDefaultTokens() { + final JavadocContentLocationCheck checkObj = new JavadocContentLocationCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default tokens are invalid") +@@ -54,7 +54,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_SECOND_LINE), + "21:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_SECOND_LINE), +@@ -63,7 +63,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFirstLine() throws Exception { ++ void firstLine() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), + "21:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), +@@ -72,7 +72,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackage() throws Exception { ++ void testPackage() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_JAVADOC_CONTENT_SECOND_LINE), + }; +@@ -80,7 +80,7 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterface() throws Exception { ++ void testInterface() throws Exception { + final String[] expected = { + "10:1: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), + }; +@@ -88,14 +88,14 @@ public class JavadocContentLocationCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOptionalSpacesAndAsterisks() throws Exception { ++ void optionalSpacesAndAsterisks() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputJavadocContentLocationTrailingSpace.java"), expected); + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), + "21:5: " + getCheckMessage(MSG_JAVADOC_CONTENT_FIRST_LINE), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java +index db528f498..a8ac9c882 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMethodCheckTest.java +@@ -34,7 +34,7 @@ import java.lang.reflect.Constructor; + import java.lang.reflect.Method; + import org.junit.jupiter.api.Test; + +-public class JavadocMethodCheckTest extends AbstractModuleTestSupport { ++final class JavadocMethodCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,7 +42,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocMethodCheck javadocMethodCheck = new JavadocMethodCheck(); + + final int[] actual = javadocMethodCheck.getAcceptableTokens(); +@@ -61,19 +61,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void extendAnnotationTest() throws Exception { ++ void extendAnnotationTest() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodExtendAnnotation.java"), expected); + } + + @Test +- public void allowedAnnotationsTest() throws Exception { ++ void allowedAnnotationsTest() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodAllowedAnnotations.java"), expected); + } + + @Test +- public void testThrowsDetection() throws Exception { ++ void throwsDetection() throws Exception { + final String[] expected = { + "24:19: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "UnsupportedOperationException"), + "35:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "UnsupportedOperationException"), +@@ -94,7 +94,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExtraThrows() throws Exception { ++ void extraThrows() throws Exception { + final String[] expected = { + "53:56: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalStateException"), + "68:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalArgumentException"), +@@ -107,7 +107,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreThrows() throws Exception { ++ void ignoreThrows() throws Exception { + final String[] expected = { + "39:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalArgumentException"), + "41:23: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalStateException"), +@@ -119,7 +119,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTags() throws Exception { ++ void tags() throws Exception { + final String[] expected = { + "30:9: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "unused"), + "36: " + getCheckMessage(MSG_RETURN_EXPECTED), +@@ -148,7 +148,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictJavadoc() throws Exception { ++ void strictJavadoc() throws Exception { + final String[] expected = { + "77:29: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), + "82:22: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), +@@ -160,14 +160,14 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoJavadoc() throws Exception { ++ void noJavadoc() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodPublicOnly1.java"), expected); + } + + // pre 1.4 relaxed mode is roughly equivalent with check=protected + @Test +- public void testRelaxedJavadoc() throws Exception { ++ void relaxedJavadoc() throws Exception { + final String[] expected = { + "87:41: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), + "92:37: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "aA"), +@@ -176,19 +176,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopeInnerInterfacesPublic() throws Exception { ++ void scopeInnerInterfacesPublic() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodScopeInnerInterfaces.java"), expected); + } + + @Test +- public void testScopeAnonInnerPrivate() throws Exception { ++ void scopeAnonInnerPrivate() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodScopeAnonInner.java"), expected); + } + + @Test +- public void testScopes() throws Exception { ++ void scopes() throws Exception { + final String[] expected = { + "27: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), + "29: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), +@@ -199,7 +199,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes2() throws Exception { ++ void scopes2() throws Exception { + final String[] expected = { + "27: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), + "29: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), +@@ -209,7 +209,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludeScope() throws Exception { ++ void excludeScope() throws Exception { + final String[] expected = { + "27: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), + "31: " + getCheckMessage(MSG_UNUSED_TAG_GENERAL), +@@ -220,21 +220,21 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowMissingJavadocTags() throws Exception { ++ void allowMissingJavadocTags() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputJavadocMethodMissingJavadocNoMissingTags.java"), expected); + } + + @Test +- public void testSurroundingAccessModifier() throws Exception { ++ void surroundingAccessModifier() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputJavadocMethodSurroundingAccessModifier.java"), expected); + } + + @Test +- public void testDoAllowMissingJavadocTagsByDefault() throws Exception { ++ void doAllowMissingJavadocTagsByDefault() throws Exception { + final String[] expected = { + "22: " + getCheckMessage(MSG_RETURN_EXPECTED), + "32:26: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "number"), +@@ -247,13 +247,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetterGetter() throws Exception { ++ void setterGetter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodSetterGetter.java"), expected); + } + + @Test +- public void testTypeParamsTags() throws Exception { ++ void typeParamsTags() throws Exception { + final String[] expected = { + "37:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), + "39:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), +@@ -264,7 +264,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowUndocumentedParamsTags() throws Exception { ++ void allowUndocumentedParamsTags() throws Exception { + final String[] expected = { + "29:6: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "unexpectedParam"), + "30:6: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "unexpectedParam2"), +@@ -279,25 +279,25 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test11684081() throws Exception { ++ void test11684081() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethod_01.java"), expected); + } + + @Test +- public void test11684082() throws Exception { ++ void test11684082() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethod_02.java"), expected); + } + + @Test +- public void test11684083() throws Exception { ++ void test11684083() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethod_03.java"), expected); + } + + @Test +- public void testGenerics() throws Exception { ++ void generics() throws Exception { + final String[] expected = { + "29:34: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "RE"), + "45:13: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", ""), +@@ -308,13 +308,13 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test1379666() throws Exception { ++ void test1379666() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethod_1379666.java"), expected); + } + + @Test +- public void testInheritDoc() throws Exception { ++ void inheritDoc() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(MSG_INVALID_INHERIT_DOC), + "23:5: " + getCheckMessage(MSG_INVALID_INHERIT_DOC), +@@ -327,7 +327,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowToSkipOverridden() throws Exception { ++ void allowToSkipOverridden() throws Exception { + final String[] expected = { + "19:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), + "29:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), +@@ -336,19 +336,19 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJava8ReceiverParameter() throws Exception { ++ void java8ReceiverParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodReceiverParameter.java"), expected); + } + + @Test +- public void testJavadocInMethod() throws Exception { ++ void javadocInMethod() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocMethodJavadocInMethod.java"), expected); + } + + @Test +- public void testConstructor() throws Exception { ++ void constructor() throws Exception { + final String[] expected = { + "20:49: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "p1"), + "22:50: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "p1"), +@@ -357,7 +357,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocMethodRecordsAndCompactCtors() throws Exception { ++ void javadocMethodRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "28:27: " + getCheckMessage(MSG_EXPECTED_TAG, "@throws", "IllegalArgumentException"), + "41:27: " +@@ -375,7 +375,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final int[] expected = { + TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.ENUM_DEF, TokenTypes.RECORD_DEF, + }; +@@ -385,7 +385,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokenToString() throws Exception { ++ void tokenToString() throws Exception { + final Class tokenType = + Class.forName( + "com.puppycrawl.tools.checkstyle.checks.javadoc." + "JavadocMethodCheck$Token"); +@@ -399,20 +399,20 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithoutLogErrors() throws Exception { ++ void withoutLogErrors() throws Exception { + verifyWithInlineConfigParser( + getPath("InputJavadocMethodLoadErrors.java"), CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testCompilationUnit() throws Exception { ++ void compilationUnit() throws Exception { + verifyWithInlineConfigParser( + getNonCompilablePath("InputJavadocMethodCompilationUnit.java"), + CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testDefaultAccessModifier() throws Exception { ++ void defaultAccessModifier() throws Exception { + final String[] expected = { + "21:32: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "a"), + "26:43: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "b"), +@@ -421,7 +421,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAccessModifierEnum() throws Exception { ++ void accessModifierEnum() throws Exception { + final String[] expected = { + "27:17: " + getCheckMessage(MSG_EXPECTED_TAG, "@param", "i"), + }; +@@ -429,7 +429,7 @@ public class JavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomMessages() throws Exception { ++ void customMessages() throws Exception { + final String msgReturnExpectedCustom = "@return tag should be present and have description :)"; + final String msgUnusedTagCustom = "Unused @param tag for 'unused' :)"; + final String msgExpectedTagCustom = "Expected @param tag for 'a' :)"; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingLeadingAsteriskCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingLeadingAsteriskCheckTest.java +index 811fba09a..92761c56e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingLeadingAsteriskCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingLeadingAsteriskCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSupport { ++final class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocMissingLeadingAsteriskCheck checkObj = new JavadocMissingLeadingAsteriskCheck(); + final int[] expected = { + JavadocTokenTypes.NEWLINE, +@@ -46,14 +46,14 @@ public class JavadocMissingLeadingAsteriskCheckTest extends AbstractModuleTestSu + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputJavadocMissingLeadingAsteriskCorrect.java"), expected); + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_MISSING_ASTERISK), + "18: " + getCheckMessage(MSG_MISSING_ASTERISK), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingWhitespaceAfterAsteriskCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingWhitespaceAfterAsteriskCheckTest.java +index 5ad8df0c8..df95cfbca 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingWhitespaceAfterAsteriskCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocMissingWhitespaceAfterAsteriskCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModuleTestSupport { ++final class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocMissingWhitespaceAfterAsteriskCheck checkObj = + new JavadocMissingWhitespaceAfterAsteriskCheck(); + final int[] expected = { +@@ -48,7 +48,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu + } + + @Test +- public void testGetRequiredJavadocTokens() { ++ void getRequiredJavadocTokens() { + final JavadocMissingWhitespaceAfterAsteriskCheck checkObj = + new JavadocMissingWhitespaceAfterAsteriskCheck(); + final int[] expected = { +@@ -60,7 +60,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu + } + + @Test +- public void testValid() throws Exception { ++ void valid() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -68,7 +68,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu + } + + @Test +- public void testValidWithTabCharacter() throws Exception { ++ void validWithTabCharacter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -76,7 +76,7 @@ public class JavadocMissingWhitespaceAfterAsteriskCheckTest extends AbstractModu + } + + @Test +- public void testInvalid() throws Exception { ++ void invalid() throws Exception { + final String[] expected = { + "10:4: " + getCheckMessage(MSG_KEY), + "16:7: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java +index 8ed8511ec..0053b23f7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImplTest.java +@@ -24,10 +24,10 @@ import static com.google.common.truth.Truth.assertWithMessage; + import com.puppycrawl.tools.checkstyle.api.JavadocTokenTypes; + import org.junit.jupiter.api.Test; + +-public class JavadocNodeImplTest { ++final class JavadocNodeImplTest { + + @Test +- public void testToString() { ++ void testToString() { + final JavadocNodeImpl javadocNode = new JavadocNodeImpl(); + javadocNode.setType(JavadocTokenTypes.CODE_LITERAL); + javadocNode.setLineNumber(1); +@@ -43,7 +43,7 @@ public class JavadocNodeImplTest { + } + + @Test +- public void testGetColumnNumber() { ++ void getColumnNumber() { + final JavadocNodeImpl javadocNode = new JavadocNodeImpl(); + javadocNode.setColumnNumber(1); + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java +index b75fb82f7..7821f7c12 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocPackageCheckTest.java +@@ -23,15 +23,15 @@ import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.MSG_LEGACY_PACKAGE_HTML; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck.MSG_PACKAGE_INFO; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.FileText; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; +-import java.util.Collections; + import org.junit.jupiter.api.Test; + +-public class JavadocPackageCheckTest extends AbstractModuleTestSupport { ++final class JavadocPackageCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +39,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissing() throws Exception { ++ void missing() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_PACKAGE_INFO), + }; +@@ -47,7 +47,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingWithAllowLegacy() throws Exception { ++ void missingWithAllowLegacy() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_PACKAGE_INFO), + }; +@@ -55,7 +55,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithMultipleFiles() throws Exception { ++ void withMultipleFiles() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_PACKAGE_INFO), + }; +@@ -66,7 +66,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBoth() throws Exception { ++ void both() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_LEGACY_PACKAGE_HTML), + }; +@@ -75,7 +75,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtmlDisallowed() throws Exception { ++ void htmlDisallowed() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_PACKAGE_INFO), + }; +@@ -84,7 +84,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtmlAllowed() throws Exception { ++ void htmlAllowed() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("pkghtml" + File.separator + "InputJavadocPackageHtmlIgnored2.java"), +@@ -93,7 +93,7 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("annotation" + File.separator + "package-info.java"), expected); +@@ -104,10 +104,10 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + * invalid canonical path. + */ + @Test +- public void testCheckstyleExceptionIfFailedToGetCanonicalPathToFile() { ++ void checkstyleExceptionIfFailedToGetCanonicalPathToFile() { + final JavadocPackageCheck check = new JavadocPackageCheck(); + final File fileWithInvalidPath = new File("\u0000\u0000\u0000"); +- final FileText mockFileText = new FileText(fileWithInvalidPath, Collections.emptyList()); ++ final FileText mockFileText = new FileText(fileWithInvalidPath, ImmutableList.of()); + final String expectedExceptionMessage = + "Exception while getting canonical path to file " + fileWithInvalidPath.getPath(); + try { +@@ -121,13 +121,13 @@ public class JavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonJava() throws Exception { ++ void nonJava() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocPackageNotJava.txt"), expected); + } + + @Test +- public void testWithFileWithoutParent() throws Exception { ++ void withFileWithoutParent() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("annotation" + File.separator + "package-info.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java +index 064a18813..a463c0bfb 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocParagraphCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { ++final class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,7 +38,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final JavadocParagraphCheck checkObj = new JavadocParagraphCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default required tokens are invalid") +@@ -47,14 +47,14 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocParagraphCorrect.java"), expected); + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_MISPLACED_TAG), + "13: " + getCheckMessage(MSG_LINE_BEFORE), +@@ -97,7 +97,7 @@ public class JavadocParagraphCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowNewlineParagraph() throws Exception { ++ void allowNewlineParagraph() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_LINE_BEFORE), + "14: " + getCheckMessage(MSG_LINE_BEFORE), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java +index 5234be856..0156cc82b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocStyleCheckTest.java +@@ -32,7 +32,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import org.junit.jupiter.api.Test; + +-public class JavadocStyleCheckTest extends AbstractModuleTestSupport { ++final class JavadocStyleCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocStyleCheck javadocStyleCheck = new JavadocStyleCheck(); + + final int[] actual = javadocStyleCheck.getAcceptableTokens(); +@@ -63,7 +63,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleDefaultSettingsOne() throws Exception { ++ void javadocStyleDefaultSettingsOne() throws Exception { + final String[] expected = { + "23: " + getCheckMessage(MSG_NO_PERIOD), + "48: " + getCheckMessage(MSG_NO_PERIOD), +@@ -88,7 +88,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleDefaultSettingsTwo() throws Exception { ++ void javadocStyleDefaultSettingsTwo() throws Exception { + final String[] expected = { + "61:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
// violation"), + "66: " + getCheckMessage(MSG_NO_PERIOD), +@@ -99,7 +99,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleDefaultSettingsThree() throws Exception { ++ void javadocStyleDefaultSettingsThree() throws Exception { + final String[] expected = { + "103:21: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), + }; +@@ -108,7 +108,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleDefaultSettingsFour() throws Exception { ++ void javadocStyleDefaultSettingsFour() throws Exception { + final String[] expected = { + "29:33: " + getCheckMessage(MSG_UNCLOSED_HTML, " // violation"), + "40: " + getCheckMessage(MSG_NO_PERIOD), +@@ -126,7 +126,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleFirstSentenceOne() throws Exception { ++ void javadocStyleFirstSentenceOne() throws Exception { + final String[] expected = { + "23: " + getCheckMessage(MSG_NO_PERIOD), + "48: " + getCheckMessage(MSG_NO_PERIOD), +@@ -139,7 +139,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleFirstSentenceTwo() throws Exception { ++ void javadocStyleFirstSentenceTwo() throws Exception { + final String[] expected = { + "66: " + getCheckMessage(MSG_NO_PERIOD), "99: " + getCheckMessage(MSG_NO_PERIOD), + }; +@@ -148,14 +148,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleFirstSentenceThree() throws Exception { ++ void javadocStyleFirstSentenceThree() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleFirstSentenceThree.java"), expected); + } + + @Test +- public void testJavadocStyleFirstSentenceFour() throws Exception { ++ void javadocStyleFirstSentenceFour() throws Exception { + final String[] expected = { + "40: " + getCheckMessage(MSG_NO_PERIOD), + "50: " + getCheckMessage(MSG_NO_PERIOD), +@@ -169,7 +169,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleFirstSentenceFormatOne() throws Exception { ++ void javadocStyleFirstSentenceFormatOne() throws Exception { + final String[] expected = { + "23: " + getCheckMessage(MSG_NO_PERIOD), + "33: " + getCheckMessage(MSG_NO_PERIOD), +@@ -184,7 +184,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleFirstSentenceFormatTwo() throws Exception { ++ void javadocStyleFirstSentenceFormatTwo() throws Exception { + final String[] expected = { + "66: " + getCheckMessage(MSG_NO_PERIOD), "99: " + getCheckMessage(MSG_NO_PERIOD), + }; +@@ -193,7 +193,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleFirstSentenceFormatThree() throws Exception { ++ void javadocStyleFirstSentenceFormatThree() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -201,7 +201,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleFirstSentenceFormatFour() throws Exception { ++ void javadocStyleFirstSentenceFormatFour() throws Exception { + final String[] expected = { + "40: " + getCheckMessage(MSG_NO_PERIOD), + "50: " + getCheckMessage(MSG_NO_PERIOD), +@@ -216,7 +216,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtml1() throws Exception { ++ void html1() throws Exception { + final String[] expected = { + "55:11: " + + getCheckMessage( +@@ -236,7 +236,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtml2() throws Exception { ++ void html2() throws Exception { + final String[] expected = { + "67:8: " + getCheckMessage(MSG_UNCLOSED_HTML, "
// violation"), + }; +@@ -245,7 +245,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtml3() throws Exception { ++ void html3() throws Exception { + final String[] expected = { + "102:21: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), + }; +@@ -254,7 +254,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtml4() throws Exception { ++ void html4() throws Exception { + final String[] expected = { + "28:33: " + getCheckMessage(MSG_UNCLOSED_HTML, " // violation"), + "45:11: " +@@ -266,28 +266,28 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtmlComment() throws Exception { ++ void htmlComment() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleHtmlComment.java"), expected); + } + + @Test +- public void testOnInputWithNoJavadoc1() throws Exception { ++ void onInputWithNoJavadoc1() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleNoJavadoc1.java"), expected); + } + + @Test +- public void testOnInputWithNoJavadoc2() throws Exception { ++ void onInputWithNoJavadoc2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleNoJavadoc2.java"), expected); + } + + @Test +- public void testScopePublic() throws Exception { ++ void scopePublic() throws Exception { + final String[] expected = { + "75: " + getCheckMessage(MSG_NO_PERIOD), + "76:31: " + getCheckMessage(MSG_EXTRA_HTML, " // violation"), +@@ -305,7 +305,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopeProtected() throws Exception { ++ void scopeProtected() throws Exception { + final String[] expected = { + "65: " + getCheckMessage(MSG_NO_PERIOD), + "66:23: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail // violation"), +@@ -326,7 +326,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopePackage() throws Exception { ++ void scopePackage() throws Exception { + final String[] expected = { + "65: " + getCheckMessage(MSG_NO_PERIOD), + "66:24: " + getCheckMessage(MSG_UNCLOSED_HTML, "should fail // violation"), +@@ -352,14 +352,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyJavadoc1() throws Exception { ++ void emptyJavadoc1() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleEmptyJavadoc1.java"), expected); + } + + @Test +- public void testEmptyJavadoc2() throws Exception { ++ void emptyJavadoc2() throws Exception { + final String[] expected = { + "75: " + getCheckMessage(MSG_EMPTY), + "79: " + getCheckMessage(MSG_EMPTY), +@@ -372,21 +372,21 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyJavadoc3() throws Exception { ++ void emptyJavadoc3() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleEmptyJavadoc3.java"), expected); + } + + @Test +- public void testEmptyJavadoc4() throws Exception { ++ void emptyJavadoc4() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleEmptyJavadoc4.java"), expected); + } + + @Test +- public void testExcludeScope() throws Exception { ++ void excludeScope() throws Exception { + final String[] expected = { + "23: " + getCheckMessage(MSG_NO_PERIOD), + "48: " + getCheckMessage(MSG_NO_PERIOD), +@@ -415,7 +415,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void packageInfoInheritDoc() throws Exception { ++ void packageInfoInheritDoc() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_NO_PERIOD), + }; +@@ -427,7 +427,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void packageInfoInvalid() throws Exception { ++ void packageInfoInvalid() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_NO_PERIOD), + }; +@@ -439,7 +439,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void packageInfoAnnotation() throws Exception { ++ void packageInfoAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -448,7 +448,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void packageInfoMissing() throws Exception { ++ void packageInfoMissing() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -456,7 +456,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void packageInfoMissingPeriod() throws Exception { ++ void packageInfoMissingPeriod() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_NO_PERIOD), + }; +@@ -466,14 +466,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNothing() throws Exception { ++ void nothing() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleNothing.java"), expected); + } + + @Test +- public void packageInfoValid() throws Exception { ++ void packageInfoValid() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -482,7 +482,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRestrictedTokenSet() throws Exception { ++ void restrictedTokenSet() throws Exception { + final String[] expected = { + "73: " + getCheckMessage(MSG_NO_PERIOD), + "336: " + getCheckMessage(MSG_NO_PERIOD), +@@ -492,7 +492,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocStyleRecordsAndCompactCtors() throws Exception { ++ void javadocStyleRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "23: " + getCheckMessage(MSG_NO_PERIOD), + "43: " + getCheckMessage(MSG_NO_PERIOD), +@@ -515,7 +515,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtmlTagToString() { ++ void htmlTagToString() { + final HtmlTag tag = new HtmlTag("id", 3, 5, true, false, ""); + assertWithMessage("Invalid toString result") + .that(tag.toString()) +@@ -525,14 +525,14 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNeverEndingXmlCommentInsideJavadoc() throws Exception { ++ void neverEndingXmlCommentInsideJavadoc() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputJavadocStyleNeverEndingXmlComment.java"), expected); + } + + @Test +- public void testInterfaceMemberScopeIsPublic() throws Exception { ++ void interfaceMemberScopeIsPublic() throws Exception { + final String[] expected = { + "20: " + getCheckMessage(MSG_EMPTY), "23: " + getCheckMessage(MSG_EMPTY), + }; +@@ -542,7 +542,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumCtorScopeIsPrivate() throws Exception { ++ void enumCtorScopeIsPrivate() throws Exception { + final String[] expected = { + "20: " + getCheckMessage(MSG_EMPTY), + "23: " + getCheckMessage(MSG_EMPTY), +@@ -553,7 +553,7 @@ public class JavadocStyleCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLowerCasePropertyForTag() throws Exception { ++ void lowerCasePropertyForTag() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java +index c2c74db4d..3d7543b02 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagContinuationIndentationCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTestSupport { ++final class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final JavadocTagContinuationIndentationCheck checkObj = + new JavadocTagContinuationIndentationCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; +@@ -45,14 +45,14 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe + } + + @Test +- public void testFp() throws Exception { ++ void fp() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputJavadocTagContinuationIndentationGuavaFalsePositive.java"), expected); + } + + @Test +- public void testCheck() throws Exception { ++ void check() throws Exception { + final String[] expected = { + "55: " + getCheckMessage(MSG_KEY, 4), + "117: " + getCheckMessage(MSG_KEY, 4), +@@ -73,7 +73,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe + } + + @Test +- public void testCheckWithOffset3() throws Exception { ++ void checkWithOffset3() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_KEY, 3), "27: " + getCheckMessage(MSG_KEY, 3), + }; +@@ -82,7 +82,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe + } + + @Test +- public void testCheckWithDescription() throws Exception { ++ void checkWithDescription() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_KEY, 4), + "17: " + getCheckMessage(MSG_KEY, 4), +@@ -96,7 +96,7 @@ public class JavadocTagContinuationIndentationCheckTest extends AbstractModuleTe + } + + @Test +- public void testBlockTag() throws Exception { ++ void blockTag() throws Exception { + final String[] expected = { + "21: " + getCheckMessage(MSG_KEY, 4), + "32: " + getCheckMessage(MSG_KEY, 4), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java +index 87950a98b..512677bff 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagInfoTest.java +@@ -26,14 +26,14 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import java.lang.reflect.Method; + import org.junit.jupiter.api.Test; + +-public class JavadocTagInfoTest { ++final class JavadocTagInfoTest { + + /* Additional test for jacoco, since valueOf() + * is generated by javac and jacoco reports that + * valueOf() is uncovered. + */ + @Test +- public void testJavadocTagInfoValueOf() { ++ void javadocTagInfoValueOf() { + final JavadocTagInfo tag = JavadocTagInfo.valueOf("AUTHOR"); + assertWithMessage("Invalid valueOf result").that(tag).isEqualTo(JavadocTagInfo.AUTHOR); + } +@@ -43,7 +43,7 @@ public class JavadocTagInfoTest { + * valueOf() is uncovered. + */ + @Test +- public void testTypeValueOf() { ++ void typeValueOf() { + final JavadocTagInfo.Type type = JavadocTagInfo.Type.valueOf("BLOCK"); + assertWithMessage("Invalid valueOf result").that(type).isEqualTo(JavadocTagInfo.Type.BLOCK); + } +@@ -53,7 +53,7 @@ public class JavadocTagInfoTest { + * values() is uncovered. + */ + @Test +- public void testTypeValues() { ++ void typeValues() { + final JavadocTagInfo.Type[] expected = { + JavadocTagInfo.Type.BLOCK, JavadocTagInfo.Type.INLINE, + }; +@@ -62,7 +62,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testAuthor() { ++ void author() { + final DetailAstImpl ast = new DetailAstImpl(); + + final int[] validTypes = { +@@ -86,7 +86,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testOthers() throws ReflectiveOperationException { ++ void others() throws ReflectiveOperationException { + final JavadocTagInfo[] tags = { + JavadocTagInfo.CODE, + JavadocTagInfo.DOC_ROOT, +@@ -137,7 +137,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testDeprecated() throws ReflectiveOperationException { ++ void deprecated() throws ReflectiveOperationException { + final DetailAstImpl ast = new DetailAstImpl(); + final DetailAstImpl astParent = new DetailAstImpl(); + astParent.setType(TokenTypes.LITERAL_CATCH); +@@ -176,7 +176,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testSerial() throws ReflectiveOperationException { ++ void serial() throws ReflectiveOperationException { + final DetailAstImpl ast = new DetailAstImpl(); + final DetailAstImpl astParent = new DetailAstImpl(); + astParent.setType(TokenTypes.LITERAL_CATCH); +@@ -207,7 +207,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testException() { ++ void exception() { + final DetailAstImpl ast = new DetailAstImpl(); + + final int[] validTypes = { +@@ -227,7 +227,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testThrows() { ++ void testThrows() { + final DetailAstImpl ast = new DetailAstImpl(); + + final int[] validTypes = { +@@ -247,7 +247,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testVersions() { ++ void versions() { + final DetailAstImpl ast = new DetailAstImpl(); + + final int[] validTypes = { +@@ -271,7 +271,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testParam() { ++ void param() { + final DetailAstImpl ast = new DetailAstImpl(); + + final int[] validTypes = { +@@ -291,7 +291,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testReturn() { ++ void testReturn() { + final DetailAstImpl ast = new DetailAstImpl(); + final DetailAstImpl astChild = new DetailAstImpl(); + astChild.setType(TokenTypes.TYPE); +@@ -322,7 +322,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testSerialField() { ++ void serialField() { + final DetailAstImpl ast = new DetailAstImpl(); + final DetailAstImpl astChild = new DetailAstImpl(); + astChild.setType(TokenTypes.TYPE); +@@ -359,7 +359,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testSerialData() { ++ void serialData() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(TokenTypes.METHOD_DEF); + final DetailAstImpl astChild = new DetailAstImpl(); +@@ -389,7 +389,7 @@ public class JavadocTagInfoTest { + } + + @Test +- public void testCoverage() { ++ void coverage() { + assertWithMessage("Invalid type") + .that(JavadocTagInfo.VERSION.getType()) + .isEqualTo(JavadocTagInfo.Type.BLOCK); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java +index 92efe0fca..709f11c82 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTagTest.java +@@ -25,14 +25,14 @@ import static com.google.common.truth.Truth.assertWithMessage; + import com.puppycrawl.tools.checkstyle.utils.JavadocUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocTagTest { ++final class JavadocTagTest { + + /* Additional test for jacoco, since valueOf() + * is generated by javac and jacoco reports that + * valueOf() is uncovered. + */ + @Test +- public void testJavadocTagTypeValueOf() { ++ void javadocTagTypeValueOf() { + final JavadocUtil.JavadocTagType enumConst = JavadocUtil.JavadocTagType.valueOf("ALL"); + assertWithMessage("Invalid enum valueOf result") + .that(enumConst) +@@ -44,7 +44,7 @@ public class JavadocTagTest { + * values() is uncovered. + */ + @Test +- public void testJavadocTagTypeValues() { ++ void javadocTagTypeValues() { + final JavadocUtil.JavadocTagType[] enumConstants = JavadocUtil.JavadocTagType.values(); + final JavadocUtil.JavadocTagType[] expected = { + JavadocUtil.JavadocTagType.BLOCK, +@@ -55,7 +55,7 @@ public class JavadocTagTest { + } + + @Test +- public void testToString() { ++ void testToString() { + final JavadocTag javadocTag = new JavadocTag(0, 1, "author", "firstArg"); + + final String result = javadocTag.toString(); +@@ -66,7 +66,7 @@ public class JavadocTagTest { + } + + @Test +- public void testJavadocTagReferenceImports() { ++ void javadocTagReferenceImports() { + assertThat(new JavadocTag(0, 0, "see", null).canReferenceImports()).isTrue(); + assertThat(new JavadocTag(0, 0, "link", null).canReferenceImports()).isTrue(); + assertThat(new JavadocTag(0, 0, "value", null).canReferenceImports()).isTrue(); +@@ -76,7 +76,7 @@ public class JavadocTagTest { + } + + @Test +- public void testJavadocTagReferenceImportsInvalid() { ++ void javadocTagReferenceImportsInvalid() { + assertThat(new JavadocTag(0, 0, "author", null).canReferenceImports()).isFalse(); + } + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java +index b2418b227..1ee881a8e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocTypeCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocTypeCheckTest extends AbstractModuleTestSupport { ++final class JavadocTypeCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,7 +38,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final JavadocTypeCheck javadocTypeCheck = new JavadocTypeCheck(); + assertWithMessage("JavadocTypeCheck#getRequiredTokens should return empty array by default") + .that(javadocTypeCheck.getRequiredTokens()) +@@ -46,7 +46,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocTypeCheck javadocTypeCheck = new JavadocTypeCheck(); + + final int[] actual = javadocTypeCheck.getAcceptableTokens(); +@@ -62,43 +62,43 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTags() throws Exception { ++ void tags() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeTags.java"), expected); + } + + @Test +- public void testInner() throws Exception { ++ void inner() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeInner.java"), expected); + } + + @Test +- public void testStrict() throws Exception { ++ void strict() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypePublicOnly.java"), expected); + } + + @Test +- public void testProtected() throws Exception { ++ void testProtected() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypePublicOnly1.java"), expected); + } + + @Test +- public void testPublic() throws Exception { ++ void testPublic() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeScopeInnerInterfaces.java"), expected); + } + + @Test +- public void testProtest() throws Exception { ++ void protest() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeScopeInnerInterfaces1.java"), expected); + } + + @Test +- public void testPkg() throws Exception { ++ void pkg() throws Exception { + final String[] expected = { + "53:5: " + getCheckMessage(MSG_MISSING_TAG, "@param "), + }; +@@ -106,13 +106,13 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEclipse() throws Exception { ++ void eclipse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeScopeInnerClasses1.java"), expected); + } + + @Test +- public void testAuthorRequired() throws Exception { ++ void authorRequired() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + }; +@@ -120,7 +120,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAuthorRegularEx() throws Exception { ++ void authorRegularEx() throws Exception { + final String[] expected = { + "31:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + "67:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), +@@ -130,7 +130,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAuthorRegularExError() throws Exception { ++ void authorRegularExError() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), + "31:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), +@@ -146,7 +146,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVersionRequired() throws Exception { ++ void versionRequired() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_MISSING_TAG, "@version"), + }; +@@ -154,7 +154,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVersionRegularEx() throws Exception { ++ void versionRegularEx() throws Exception { + final String[] expected = { + "31:1: " + getCheckMessage(MSG_MISSING_TAG, "@version"), + "67:1: " + getCheckMessage(MSG_MISSING_TAG, "@version"), +@@ -164,7 +164,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVersionRegularExError() throws Exception { ++ void versionRegularExError() throws Exception { + final String[] expected = { + "22:1: " + getCheckMessage(MSG_TAG_FORMAT, "@version", "\\$Revision.*\\$"), + "31:1: " + getCheckMessage(MSG_MISSING_TAG, "@version"), +@@ -183,7 +183,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes() throws Exception { ++ void scopes() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), + "137:5: " + getCheckMessage(MSG_MISSING_TAG, "@param "), +@@ -192,13 +192,13 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLimitViolationsBySpecifyingTokens() throws Exception { ++ void limitViolationsBySpecifyingTokens() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeNoJavadocOnInterface.java"), expected); + } + + @Test +- public void testScopes2() throws Exception { ++ void scopes2() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), + }; +@@ -206,7 +206,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludeScope() throws Exception { ++ void excludeScope() throws Exception { + final String[] expected = { + "137:5: " + getCheckMessage(MSG_MISSING_TAG, "@param "), + }; +@@ -214,7 +214,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTypeParameters() throws Exception { ++ void typeParameters() throws Exception { + final String[] expected = { + "21:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), + "25:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), +@@ -226,7 +226,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowMissingTypeParameters() throws Exception { ++ void allowMissingTypeParameters() throws Exception { + final String[] expected = { + "21:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), + "58:8: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), +@@ -236,7 +236,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDontAllowUnusedParameterTag() throws Exception { ++ void dontAllowUnusedParameterTag() throws Exception { + final String[] expected = { + "20:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", "BAD"), + "21:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), +@@ -246,7 +246,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBadTag() throws Exception { ++ void badTag() throws Exception { + final String[] expected = { + "19:4: " + getCheckMessage(MSG_UNKNOWN_TAG, "mytag"), + }; +@@ -254,40 +254,40 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBadTagSuppress() throws Exception { ++ void badTagSuppress() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeBadTag_1.java"), expected); + } + + @Test +- public void testAllowedAnnotationsDefault() throws Exception { ++ void allowedAnnotationsDefault() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeAllowedAnnotations.java"), expected); + } + + @Test +- public void testAllowedAnnotationsWithFullyQualifiedName() throws Exception { ++ void allowedAnnotationsWithFullyQualifiedName() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeAllowedAnnotations_1.java"), expected); + } + + @Test +- public void testAllowedAnnotationsAllowed() throws Exception { ++ void allowedAnnotationsAllowed() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeAllowedAnnotations_2.java"), expected); + } + + @Test +- public void testAllowedAnnotationsNotAllowed() throws Exception { ++ void allowedAnnotationsNotAllowed() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocTypeAllowedAnnotations_3.java"), expected); + } + + @Test +- public void testJavadocTypeRecords() throws Exception { ++ void javadocTypeRecords() throws Exception { + final String[] expected = { + "24:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), + "33:1: " + getCheckMessage(MSG_MISSING_TAG, "@author"), +@@ -299,7 +299,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocTypeRecordComponents() throws Exception { ++ void javadocTypeRecordComponents() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -308,7 +308,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocTypeRecordComponents2() throws Exception { ++ void javadocTypeRecordComponents2() throws Exception { + + final String[] expected = { + "44:1: " + getCheckMessage(MSG_MISSING_TAG, "@param "), +@@ -329,7 +329,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocTypeInterfaceMemberScopeIsPublic() throws Exception { ++ void javadocTypeInterfaceMemberScopeIsPublic() throws Exception { + + final String[] expected = { + "19:5: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), +@@ -340,7 +340,7 @@ public class JavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "21:4: " + getCheckMessage(MSG_UNUSED_TAG, "@param", ""), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java +index bffd038c9..2f2756453 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocVariableCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class JavadocVariableCheckTest extends AbstractModuleTestSupport { ++final class JavadocVariableCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final JavadocVariableCheck javadocVariableCheck = new JavadocVariableCheck(); + final int[] actual = javadocVariableCheck.getRequiredTokens(); + final int[] expected = { +@@ -45,7 +45,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavadocVariableCheck javadocVariableCheck = new JavadocVariableCheck(); + + final int[] actual = javadocVariableCheck.getAcceptableTokens(); +@@ -57,7 +57,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "311:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -68,7 +68,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnother() throws Exception { ++ void another() throws Exception { + final String[] expected = { + "23:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -78,13 +78,13 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnother2() throws Exception { ++ void another2() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavadocVariableInner2.java"), expected); + } + + @Test +- public void testAnother3() throws Exception { ++ void another3() throws Exception { + final String[] expected = { + "17:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "22:13: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -98,7 +98,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnother4() throws Exception { ++ void another4() throws Exception { + final String[] expected = { + "52:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -106,7 +106,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes() throws Exception { ++ void scopes() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -150,7 +150,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes2() throws Exception { ++ void scopes2() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -161,7 +161,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludeScope() throws Exception { ++ void excludeScope() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "18:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -201,7 +201,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoredVariableNames() throws Exception { ++ void ignoredVariableNames() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -244,7 +244,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDoNotIgnoreAnythingWhenIgnoreNamePatternIsEmpty() throws Exception { ++ void doNotIgnoreAnythingWhenIgnoreNamePatternIsEmpty() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -288,7 +288,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaLocalVariablesDoNotNeedJavadoc() throws Exception { ++ void lambdaLocalVariablesDoNotNeedJavadoc() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -297,7 +297,7 @@ public class JavadocVariableCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceMemberScopeIsPublic() throws Exception { ++ void interfaceMemberScopeIsPublic() throws Exception { + final String[] expected = { + "18:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheckTest.java +index 691280b80..0dad4dbc6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocMethodCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { ++final class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MissingJavadocMethodCheck missingJavadocMethodCheck = new MissingJavadocMethodCheck(); + + final int[] actual = missingJavadocMethodCheck.getAcceptableTokens(); +@@ -50,7 +50,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MissingJavadocMethodCheck missingJavadocMethodCheck = new MissingJavadocMethodCheck(); + final int[] actual = missingJavadocMethodCheck.getRequiredTokens(); + final int[] expected = CommonUtil.EMPTY_INT_ARRAY; +@@ -58,7 +58,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void extendAnnotationTest() throws Exception { ++ void extendAnnotationTest() throws Exception { + final String[] expected = { + "44:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -67,7 +67,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void newTest() throws Exception { ++ void newTest() throws Exception { + final String[] expected = { + "70:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -75,7 +75,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void allowedAnnotationsTest() throws Exception { ++ void allowedAnnotationsTest() throws Exception { + final String[] expected = { + "32:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -84,7 +84,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTags() throws Exception { ++ void tags() throws Exception { + final String[] expected = { + "23:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "337:9: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -95,7 +95,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrictJavadoc() throws Exception { ++ void strictJavadoc() throws Exception { + final String[] expected = { + "24:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:13: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -114,14 +114,14 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoJavadoc() throws Exception { ++ void noJavadoc() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMissingJavadocMethodPublicOnly2.java"), expected); + } + + // pre 1.4 relaxed mode is roughly equivalent with check=protected + @Test +- public void testRelaxedJavadoc() throws Exception { ++ void relaxedJavadoc() throws Exception { + final String[] expected = { + "65:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "69:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -132,7 +132,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopeInnerInterfacesPublic() throws Exception { ++ void scopeInnerInterfacesPublic() throws Exception { + final String[] expected = { + "52:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "53:9: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -142,7 +142,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceMemberScopeIsPublic() throws Exception { ++ void interfaceMemberScopeIsPublic() throws Exception { + final String[] expected = { + "22:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "30:9: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -152,7 +152,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumCtorScopeIsPrivate() throws Exception { ++ void enumCtorScopeIsPrivate() throws Exception { + final String[] expected = { + "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -161,13 +161,13 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopeAnonInnerPrivate() throws Exception { ++ void scopeAnonInnerPrivate() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMissingJavadocMethodScopeAnonInner.java"), expected); + } + + @Test +- public void testScopeAnonInnerAnonInner() throws Exception { ++ void scopeAnonInnerAnonInner() throws Exception { + final String[] expected = { + "34:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "47:13: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -178,7 +178,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes() throws Exception { ++ void scopes() throws Exception { + final String[] expected = { + "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "27:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -222,7 +222,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes2() throws Exception { ++ void scopes2() throws Exception { + final String[] expected = { + "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "27:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -233,7 +233,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludeScope() throws Exception { ++ void excludeScope() throws Exception { + final String[] expected = { + "27:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "29:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -265,14 +265,14 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDoAllowMissingJavadocTagsByDefault() throws Exception { ++ void doAllowMissingJavadocTagsByDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputMissingJavadocMethodMissingJavadocTags.java"), expected); + } + + @Test +- public void testSetterGetterOff() throws Exception { ++ void setterGetterOff() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -296,7 +296,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetterGetterOn() throws Exception { ++ void setterGetterOn() throws Exception { + final String[] expected = { + "30:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "35:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -317,26 +317,26 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test11684081() throws Exception { ++ void test11684081() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMissingJavadocMethod_01.java"), expected); + } + + @Test +- public void test11684082() throws Exception { ++ void test11684082() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMissingJavadocMethod_02.java"), expected); + } + + @Test +- public void testSkipCertainMethods() throws Exception { ++ void skipCertainMethods() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputMissingJavadocMethodIgnoreNameRegex.java"), expected); + } + + @Test +- public void testNotSkipAnythingWhenSkipRegexDoesNotMatch() throws Exception { ++ void notSkipAnythingWhenSkipRegexDoesNotMatch() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -347,21 +347,21 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowToSkipOverridden() throws Exception { ++ void allowToSkipOverridden() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputMissingJavadocMethodsNotSkipWritten.java"), expected); + } + + @Test +- public void testJava8ReceiverParameter() throws Exception { ++ void java8ReceiverParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputMissingJavadocMethodReceiverParameter.java"), expected); + } + + @Test +- public void testJavadocInMethod() throws Exception { ++ void javadocInMethod() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -373,7 +373,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testConstructor() throws Exception { ++ void constructor() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -381,14 +381,14 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotPublicInterfaceMethods() throws Exception { ++ void notPublicInterfaceMethods() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputMissingJavadocMethodInterfacePrivateMethod.java"), expected); + } + + @Test +- public void testPublicMethods() throws Exception { ++ void publicMethods() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "24:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -400,7 +400,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingJavadocMethodRecordsAndCompactCtors() throws Exception { ++ void missingJavadocMethodRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "22:9: " + getCheckMessage(MSG_JAVADOC_MISSING), + "27:9: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -414,7 +414,7 @@ public class MissingJavadocMethodCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingJavadocMethodRecordsAndCompactCtorsMinLineCount() throws Exception { ++ void missingJavadocMethodRecordsAndCompactCtorsMinLineCount() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheckTest.java +index 6ff534cf9..e04c2d045 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocPackageCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { ++final class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,31 +35,31 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageJavadocPresent() throws Exception { ++ void packageJavadocPresent() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("package-info.java"), expected); + } + + @Test +- public void testPackageSingleLineJavadocPresent() throws Exception { ++ void packageSingleLineJavadocPresent() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("singleline/package-info.java"), expected); + } + + @Test +- public void testPackageJavadocPresentWithAnnotation() throws Exception { ++ void packageJavadocPresentWithAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("annotation/package-info.java"), expected); + } + + @Test +- public void testPackageJavadocPresentWithBlankLines() throws Exception { ++ void packageJavadocPresentWithBlankLines() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("blank/package-info.java"), expected); + } + + @Test +- public void testPackageJavadocMissing() throws Exception { ++ void packageJavadocMissing() throws Exception { + final String[] expected = { + "7:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -67,7 +67,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlockCommentInsteadOfJavadoc() throws Exception { ++ void blockCommentInsteadOfJavadoc() throws Exception { + final String[] expected = { + "10:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -75,7 +75,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSinglelineCommentInsteadOfJavadoc() throws Exception { ++ void singlelineCommentInsteadOfJavadoc() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -83,7 +83,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSinglelineCommentInsteadOfJavadoc2() throws Exception { ++ void singlelineCommentInsteadOfJavadoc2() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -91,7 +91,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageJavadocMissingWithAnnotation() throws Exception { ++ void packageJavadocMissingWithAnnotation() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -99,7 +99,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageJavadocMissingWithAnnotationAndBlockComment() throws Exception { ++ void packageJavadocMissingWithAnnotationAndBlockComment() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -108,7 +108,7 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageJavadocMissingDetachedJavadoc() throws Exception { ++ void packageJavadocMissingDetachedJavadoc() throws Exception { + final String[] expected = { + "11:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -116,13 +116,13 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageJavadocPresentWithHeader() throws Exception { ++ void packageJavadocPresentWithHeader() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("header/package-info.java"), expected); + } + + @Test +- public void testPackageJavadocMissingWithBlankLines() throws Exception { ++ void packageJavadocMissingWithBlankLines() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_PKG_JAVADOC_MISSING), + }; +@@ -130,14 +130,14 @@ public class MissingJavadocPackageCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotPackageInfo() throws Exception { ++ void notPackageInfo() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyFilterWithInlineConfigParser( + getPath("InputMissingJavadocPackageNotPackageInfo-package-info.java"), expected); + } + + @Test +- public void testTokensAreCorrect() { ++ void tokensAreCorrect() { + final MissingJavadocPackageCheck check = new MissingJavadocPackageCheck(); + final int[] expected = { + TokenTypes.PACKAGE_DEF, +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java +index e7b19fb46..5a986c7c4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { ++final class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MissingJavadocTypeCheck missingJavadocTypeCheck = new MissingJavadocTypeCheck(); + assertWithMessage( + "MissingJavadocTypeCheck#getRequiredTokens should return empty array by default") +@@ -44,7 +44,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MissingJavadocTypeCheck missingJavadocTypeCheck = new MissingJavadocTypeCheck(); + + final int[] actual = missingJavadocTypeCheck.getAcceptableTokens(); +@@ -60,7 +60,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTags() throws Exception { ++ void tags() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "308:1: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -70,7 +70,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInner() throws Exception { ++ void inner() throws Exception { + final String[] expected = { + "19:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "26:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -80,7 +80,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStrict() throws Exception { ++ void strict() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -91,7 +91,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProtected() throws Exception { ++ void testProtected() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -99,7 +99,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPublic() throws Exception { ++ void testPublic() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "44:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -109,7 +109,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProtest() throws Exception { ++ void protest() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "35:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -121,7 +121,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPkg() throws Exception { ++ void pkg() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "24:9: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -132,7 +132,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEclipse() throws Exception { ++ void eclipse() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -141,7 +141,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes() throws Exception { ++ void scopes() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -158,7 +158,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLimitViolationsBySpecifyingTokens() throws Exception { ++ void limitViolationsBySpecifyingTokens() throws Exception { + final String[] expected = { + "15:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + }; +@@ -167,7 +167,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testScopes2() throws Exception { ++ void scopes2() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "25:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -176,7 +176,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludeScope() throws Exception { ++ void excludeScope() throws Exception { + final String[] expected = { + "37:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "49:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -191,14 +191,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDontAllowUnusedParameterTag() throws Exception { ++ void dontAllowUnusedParameterTag() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputMissingJavadocTypeUnusedParamInJavadocForClass.java"), expected); + } + + @Test +- public void testSkipAnnotationsDefault() throws Exception { ++ void skipAnnotationsDefault() throws Exception { + + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -209,7 +209,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipAnnotationsWithFullyQualifiedName() throws Exception { ++ void skipAnnotationsWithFullyQualifiedName() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), + "17:1: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -219,14 +219,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipAnnotationsAllowed() throws Exception { ++ void skipAnnotationsAllowed() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMissingJavadocTypeSkipAnnotations3.java"), expected); + } + + @Test +- public void testSkipAnnotationsNotAllowed() throws Exception { ++ void skipAnnotationsNotAllowed() throws Exception { + + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -237,7 +237,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingJavadocTypeCheckRecords() throws Exception { ++ void missingJavadocTypeCheckRecords() throws Exception { + + final String[] expected = { + "14:1: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -253,7 +253,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceMemberScopeIsPublic() throws Exception { ++ void interfaceMemberScopeIsPublic() throws Exception { + + final String[] expected = { + "13:1: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -265,7 +265,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQualifiedAnnotation1() throws Exception { ++ void qualifiedAnnotation1() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -276,7 +276,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQualifiedAnnotation2() throws Exception { ++ void qualifiedAnnotation2() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "23:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -286,7 +286,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQualifiedAnnotation3() throws Exception { ++ void qualifiedAnnotation3() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "22:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -296,7 +296,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQualifiedAnnotation4() throws Exception { ++ void qualifiedAnnotation4() throws Exception { + final String[] expected = { + "17:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "21:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -306,14 +306,14 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQualifiedAnnotation5() throws Exception { ++ void qualifiedAnnotation5() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputMissingJavadocTypeQualifiedAnnotation5.java"), expected); + } + + @Test +- public void testMultipleQualifiedAnnotation() throws Exception { ++ void multipleQualifiedAnnotation() throws Exception { + final String[] expected = { + "29:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "38:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +@@ -323,7 +323,7 @@ public class MissingJavadocTypeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQualifiedAnnotationWithParameters() throws Exception { ++ void qualifiedAnnotationWithParameters() throws Exception { + final String[] expected = { + "33:5: " + getCheckMessage(MSG_JAVADOC_MISSING), + "37:5: " + getCheckMessage(MSG_JAVADOC_MISSING), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java +index fd05ac9f8..9b2744817 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/NonEmptyAtclauseDescriptionCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupport { ++final class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final NonEmptyAtclauseDescriptionCheck checkObj = new NonEmptyAtclauseDescriptionCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -43,7 +43,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final NonEmptyAtclauseDescriptionCheck checkObj = new NonEmptyAtclauseDescriptionCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default required tokens are invalid") +@@ -52,7 +52,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testCheckOne() throws Exception { ++ void checkOne() throws Exception { + final String[] expected = { + // this is a case with description that is sequences of spaces + "37: " + getCheckMessage(MSG_KEY), +@@ -77,7 +77,7 @@ public class NonEmptyAtclauseDescriptionCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testCheckTwo() throws Exception { ++ void checkTwo() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_KEY), + "17: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/RequireEmptyLineBeforeBlockTagGroupCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/RequireEmptyLineBeforeBlockTagGroupCheckTest.java +index 5c6f48e21..a34d20450 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/RequireEmptyLineBeforeBlockTagGroupCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/RequireEmptyLineBeforeBlockTagGroupCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModuleTestSupport { ++final class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModule + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final RequireEmptyLineBeforeBlockTagGroupCheck checkObj = + new RequireEmptyLineBeforeBlockTagGroupCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; +@@ -46,7 +46,7 @@ public class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModule + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + createModuleConfig(RequireEmptyLineBeforeBlockTagGroupCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -55,7 +55,7 @@ public class RequireEmptyLineBeforeBlockTagGroupCheckTest extends AbstractModule + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String[] expected = { + "14: " + getCheckMessage(MSG_JAVADOC_TAG_LINE_BEFORE, "@since"), + "20: " + getCheckMessage(MSG_JAVADOC_TAG_LINE_BEFORE, "@param"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java +index 79f69ade3..c698cabca 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SingleLineJavadocCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { ++final class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptableTokens() { ++ void acceptableTokens() { + final SingleLineJavadocCheck checkObj = new SingleLineJavadocCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default acceptable tokens are invalid") +@@ -43,7 +43,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final SingleLineJavadocCheck checkObj = new SingleLineJavadocCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default required tokens are invalid") +@@ -52,7 +52,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void simpleTest() throws Exception { ++ void simpleTest() throws Exception { + final String[] expected = { + "22: " + getCheckMessage(MSG_KEY), + "38: " + getCheckMessage(MSG_KEY), +@@ -64,7 +64,7 @@ public class SingleLineJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoredTags() throws Exception { ++ void ignoredTags() throws Exception { + final String[] expected = { + "14: " + getCheckMessage(MSG_KEY), + "44: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java +index 1d9791472..4d6351e9d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { ++final class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,7 +38,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final SummaryJavadocCheck checkObj = new SummaryJavadocCheck(); + final int[] expected = {TokenTypes.BLOCK_COMMENT_BEGIN}; + assertWithMessage("Default required tokens are invalid") +@@ -47,14 +47,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCorrect() throws Exception { ++ void correct() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSummaryJavadocCorrect.java"), expected); + } + + @Test +- public void testInlineCorrect() throws Exception { ++ void inlineCorrect() throws Exception { + final String[] expected = { + "112: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + }; +@@ -63,7 +63,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrect() throws Exception { ++ void incorrect() throws Exception { + final String[] expected = { + "24: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), + "42: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), +@@ -85,7 +85,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineForbidden() throws Exception { ++ void inlineForbidden() throws Exception { + final String[] expected = { + "26: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), + "31: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), +@@ -103,7 +103,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPeriod() throws Exception { ++ void period() throws Exception { + final String[] expected = { + "14: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), + "19: " + getCheckMessage(MSG_SUMMARY_FIRST_SENTENCE), +@@ -114,14 +114,14 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoPeriod() throws Exception { ++ void noPeriod() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSummaryJavadocNoPeriod.java"), expected); + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = { + "23: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), + "41: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), +@@ -142,7 +142,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrectUsageOfSummaryTag() throws Exception { ++ void incorrectUsageOfSummaryTag() throws Exception { + final String[] expected = { + "34: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), + "41: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), +@@ -158,7 +158,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineDefaultConfiguration() throws Exception { ++ void inlineDefaultConfiguration() throws Exception { + final String[] expected = { + "22: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), + "26: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), +@@ -180,7 +180,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineReturn() throws Exception { ++ void inlineReturn() throws Exception { + final String[] expected = { + "74: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), + }; +@@ -189,7 +189,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInlineReturnForbidden() throws Exception { ++ void inlineReturnForbidden() throws Exception { + final String[] expected = { + "14: " + getCheckMessage(MSG_SUMMARY_JAVADOC), + "21: " + getCheckMessage(MSG_SUMMARY_JAVADOC), +@@ -201,7 +201,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPeriodAtEnd() throws Exception { ++ void periodAtEnd() throws Exception { + final String[] expected = { + "19: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), + "26: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), +@@ -214,7 +214,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHtmlFormatSummary() throws Exception { ++ void htmlFormatSummary() throws Exception { + final String[] expected = { + "22: " + getCheckMessage(MSG_SUMMARY_MISSING_PERIOD), + "36: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), +@@ -225,7 +225,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfo() throws Exception { ++ void packageInfo() throws Exception { + final String[] expected = { + "10: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), + }; +@@ -234,7 +234,7 @@ public class SummaryJavadocCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageInfoWithAnnotation() throws Exception { ++ void packageInfoWithAnnotation() throws Exception { + final String[] expected = { + "10: " + getCheckMessage(MSG_SUMMARY_JAVADOC_MISSING), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java +index ef0aace41..44ed7dc5f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/WriteTagCheckTest.java +@@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_MISSING_TAG; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_TAG_FORMAT; + import static com.puppycrawl.tools.checkstyle.checks.javadoc.WriteTagCheck.MSG_WRITE_TAG; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.Checker; +@@ -31,14 +32,13 @@ import java.io.ByteArrayInputStream; + import java.io.File; + import java.io.InputStreamReader; + import java.io.LineNumberReader; +-import java.nio.charset.StandardCharsets; + import java.util.ArrayList; + import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.Test; + + /** Unit test for WriteTagCheck. */ +-public class WriteTagCheckTest extends AbstractModuleTestSupport { ++final class WriteTagCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -46,13 +46,13 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultSettings() throws Exception { ++ void defaultSettings() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputWriteTagDefault.java"), expected); + } + + @Test +- public void testTag() throws Exception { ++ void tag() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_WRITE_TAG, "@author", "Daniel Grenner"), + }; +@@ -60,7 +60,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingFormat() throws Exception { ++ void missingFormat() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_WRITE_TAG, "@author", "Daniel Grenner"), + }; +@@ -68,7 +68,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTagIncomplete() throws Exception { ++ void tagIncomplete() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_WRITE_TAG, "@incomplete", "This class needs more code..."), + }; +@@ -76,7 +76,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDoubleTag() throws Exception { ++ void doubleTag() throws Exception { + final String[] expected = { + "18: " + getCheckMessage(MSG_WRITE_TAG, "@doubletag", "first text"), + "19: " + getCheckMessage(MSG_WRITE_TAG, "@doubletag", "second text"), +@@ -85,7 +85,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyTag() throws Exception { ++ void emptyTag() throws Exception { + final String[] expected = { + "19: " + getCheckMessage(MSG_WRITE_TAG, "@emptytag", ""), + }; +@@ -93,7 +93,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMissingTag() throws Exception { ++ void missingTag() throws Exception { + final String[] expected = { + "20: " + getCheckMessage(MSG_MISSING_TAG, "@missingtag"), + }; +@@ -101,7 +101,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethod() throws Exception { ++ void method() throws Exception { + final String[] expected = { + "24: " + getCheckMessage(MSG_WRITE_TAG, "@todo", "Add a constructor comment"), + "36: " + getCheckMessage(MSG_WRITE_TAG, "@todo", "Add a comment"), +@@ -110,7 +110,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSeverity() throws Exception { ++ void severity() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_WRITE_TAG, "@author", "Daniel Grenner"), + }; +@@ -118,19 +118,19 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreMissing() throws Exception { ++ void ignoreMissing() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputWriteTagIgnore.java"), expected); + } + + @Test +- public void testRegularEx() throws Exception { ++ void regularEx() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputWriteTagRegularExpression.java"), expected); + } + + @Test +- public void testRegularExError() throws Exception { ++ void regularExError() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_TAG_FORMAT, "@author", "ABC"), + }; +@@ -138,7 +138,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumsAndAnnotations() throws Exception { ++ void enumsAndAnnotations() throws Exception { + final String[] expected = { + "15: " + + getCheckMessage( +@@ -159,7 +159,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoJavadocs() throws Exception { ++ void noJavadocs() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_MISSING_TAG, "null"), + }; +@@ -167,7 +167,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWriteTagRecordsAndCompactCtors() throws Exception { ++ void writeTagRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_MISSING_TAG, "@incomplete"), + "19: " + getCheckMessage(MSG_TAG_FORMAT, "@incomplete", "\\S"), +@@ -195,8 +195,7 @@ public class WriteTagCheckTest extends AbstractModuleTestSupport { + + // process each of the lines + try (ByteArrayInputStream localStream = new ByteArrayInputStream(getStream().toByteArray()); +- LineNumberReader lnr = +- new LineNumberReader(new InputStreamReader(localStream, StandardCharsets.UTF_8))) { ++ LineNumberReader lnr = new LineNumberReader(new InputStreamReader(localStream, UTF_8))) { + for (int i = 0; i < expected.length; i++) { + final String expectedResult = messageFileName + ":" + expected[i]; + final String actual = lnr.readLine(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/BlockTagUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/BlockTagUtilTest.java +index 8f887cdcd..826ade0b7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/BlockTagUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/BlockTagUtilTest.java +@@ -25,17 +25,17 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class BlockTagUtilTest { ++final class BlockTagUtilTest { + + @Test +- public void testHasPrivateConstructor() throws Exception { ++ void hasPrivateConstructor() throws Exception { + assertWithMessage("Constructor is not private") + .that(TestUtil.isUtilsClassHasPrivateConstructor(BlockTagUtil.class)) + .isTrue(); + } + + @Test +- public void testExtractBlockTags() { ++ void extractBlockTags() { + final String[] text = { + "/** @foo abc ", " * @bar def ", " @baz ghi ", " * @qux jkl", " */", + }; +@@ -57,7 +57,7 @@ public class BlockTagUtilTest { + } + + @Test +- public void testVersionStringFormat() { ++ void versionStringFormat() { + final String[] text = { + "/** ", " * @version 1.0", " */", + }; +@@ -68,7 +68,7 @@ public class BlockTagUtilTest { + } + + @Test +- public void testOddVersionString() { ++ void oddVersionString() { + final String[] text = {"/**", " * Foo", " * @version 1.0 */"}; + + final List tags = BlockTagUtil.extractBlockTags(text); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/InlineTagUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/InlineTagUtilTest.java +index 7c4c64fae..a212f3537 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/InlineTagUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/javadoc/utils/InlineTagUtilTest.java +@@ -25,17 +25,17 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class InlineTagUtilTest { ++final class InlineTagUtilTest { + + @Test +- public void testHasPrivateConstructor() throws Exception { ++ void hasPrivateConstructor() throws Exception { + assertWithMessage("Constructor is not private") + .that(TestUtil.isUtilsClassHasPrivateConstructor(InlineTagUtil.class)) + .isTrue(); + } + + @Test +- public void testExtractInlineTags() { ++ void testExtractInlineTags() { + final String[] text = { + "/** @see elsewhere ", + " * {@link List }, {@link List link text }", +@@ -54,7 +54,7 @@ public class InlineTagUtilTest { + } + + @Test +- public void testMultiLineLinkTag() { ++ void multiLineLinkTag() { + final String[] text = {"/**", " * {@link foo", " * bar baz}", " */"}; + + final List tags = InlineTagUtil.extractInlineTags(text); +@@ -64,7 +64,7 @@ public class InlineTagUtilTest { + } + + @Test +- public void testCollapseWhitespace() { ++ void collapseWhitespace() { + final String[] text = {"/**", " * {@code foo\t\t bar baz\t }", " */"}; + + final List tags = InlineTagUtil.extractInlineTags(text); +@@ -74,7 +74,7 @@ public class InlineTagUtilTest { + } + + @Test +- public void extractInlineTags() { ++ void extractInlineTags() { + final String[] source = { + " {@link foo}", + }; +@@ -88,7 +88,7 @@ public class InlineTagUtilTest { + } + + @Test +- public void testBadInputExtractInlineTagsLineFeed() { ++ void badInputExtractInlineTagsLineFeed() { + try { + InlineTagUtil.extractInlineTags("abc\ndef"); + assertWithMessage("IllegalArgumentException expected").fail(); +@@ -98,7 +98,7 @@ public class InlineTagUtilTest { + } + + @Test +- public void testBadInputExtractInlineTagsCarriageReturn() { ++ void badInputExtractInlineTagsCarriageReturn() { + try { + InlineTagUtil.extractInlineTags("abc\rdef"); + assertWithMessage("IllegalArgumentException expected").fail(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java +index 043b8e175..ad1e44ed3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/BooleanExpressionComplexityCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupport { ++final class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + + final String[] expected = { + "21:9: " + getCheckMessage(MSG_KEY, 4, 3), +@@ -51,7 +51,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testNoBitwise() throws Exception { ++ void noBitwise() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -59,7 +59,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testNullPointerException() throws Exception { ++ void nullPointerException() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -67,7 +67,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testWrongToken() { ++ void wrongToken() { + final BooleanExpressionComplexityCheck booleanExpressionComplexityCheckObj = + new BooleanExpressionComplexityCheck(); + final DetailAstImpl ast = new DetailAstImpl(); +@@ -83,7 +83,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testSmall() throws Exception { ++ void small() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -91,7 +91,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testBooleanExpressionComplexityRecordsAndCompactCtors() throws Exception { ++ void booleanExpressionComplexityRecordsAndCompactCtors() throws Exception { + + final int max = 3; + +@@ -108,7 +108,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testLeaves() throws Exception { ++ void leaves() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -116,7 +116,7 @@ public class BooleanExpressionComplexityCheckTest extends AbstractModuleTestSupp + } + + @Test +- public void testRecordLeaves() throws Exception { ++ void recordLeaves() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java +index 68420a36e..ed85d25f0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassDataAbstractionCouplingCheckTest.java +@@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSupport { ++final class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +39,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testTokens() { ++ void tokens() { + final ClassDataAbstractionCouplingCheck check = new ClassDataAbstractionCouplingCheck(); + assertWithMessage("Required tokens should not be null") + .that(check.getRequiredTokens()) +@@ -56,7 +56,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + + final String[] expected = { + "16:1: " + getCheckMessage(MSG_KEY, 4, 0, "[AnotherInnerClass, HashMap, HashSet, int]"), +@@ -68,7 +68,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testExcludedPackageDirectPackages() throws Exception { ++ void excludedPackageDirectPackages() throws Exception { + final String[] expected = { + "30:1: " + getCheckMessage(MSG_KEY, 2, 0, "[AAClass, ABClass]"), + }; +@@ -78,7 +78,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testExcludedPackageCommonPackages() throws Exception { ++ void excludedPackageCommonPackages() throws Exception { + final String[] expected = { + "28:1: " + getCheckMessage(MSG_KEY, 2, 0, "[AAClass, ABClass]"), + "32:5: " + getCheckMessage(MSG_KEY, 2, 0, "[BClass, CClass]"), +@@ -89,7 +89,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testExcludedPackageWithEndingDot() throws Exception { ++ void excludedPackageWithEndingDot() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(ClassDataAbstractionCouplingCheck.class); + +@@ -118,20 +118,20 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testExcludedPackageCommonPackagesAllIgnored() throws Exception { ++ void excludedPackageCommonPackagesAllIgnored() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputClassDataAbstractionCouplingExcludedPackagesAllIgnored.java"), expected); + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputClassDataAbstractionCoupling2.java"), expected); + } + + @Test +- public void testWrongToken() { ++ void wrongToken() { + final ClassDataAbstractionCouplingCheck classDataAbstractionCouplingCheckObj = + new ClassDataAbstractionCouplingCheck(); + final DetailAstImpl ast = new DetailAstImpl(); +@@ -147,7 +147,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testRegularExpression() throws Exception { ++ void regularExpression() throws Exception { + + final String[] expected = { + "22:1: " + getCheckMessage(MSG_KEY, 2, 0, "[AnotherInnerClass, int]"), +@@ -158,7 +158,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testEmptyRegularExpression() throws Exception { ++ void emptyRegularExpression() throws Exception { + + final String[] expected = { + "22:1: " + getCheckMessage(MSG_KEY, 4, 0, "[AnotherInnerClass, HashMap, HashSet, int]"), +@@ -170,7 +170,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testClassDataAbstractionCouplingRecords() throws Exception { ++ void classDataAbstractionCouplingRecords() throws Exception { + + final int maxAbstraction = 1; + final String[] expected = { +@@ -186,7 +186,7 @@ public class ClassDataAbstractionCouplingCheckTest extends AbstractModuleTestSup + } + + @Test +- public void testNew() throws Exception { ++ void testNew() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java +index c5b89584e..8a3fad4b5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/ClassFanOutComplexityCheckTest.java +@@ -36,7 +36,7 @@ import java.util.Map; + import java.util.Optional; + import org.junit.jupiter.api.Test; + +-public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { ++final class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -44,7 +44,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + + final String[] expected = { + "27:1: " + getCheckMessage(MSG_KEY, 3, 0), "59:1: " + getCheckMessage(MSG_KEY, 1, 0), +@@ -54,7 +54,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludedPackagesDirectPackages() throws Exception { ++ void excludedPackagesDirectPackages() throws Exception { + final String[] expected = { + "29:1: " + getCheckMessage(MSG_KEY, 2, 0), + }; +@@ -64,7 +64,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludedPackagesCommonPackages() throws Exception { ++ void excludedPackagesCommonPackages() throws Exception { + final String[] expected = { + "28:1: " + getCheckMessage(MSG_KEY, 2, 0), + "32:5: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -75,7 +75,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludedPackagesCommonPackagesWithEndingDot() throws Exception { ++ void excludedPackagesCommonPackagesWithEndingDot() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ClassFanOutComplexityCheck.class); + + checkConfig.addProperty("max", "0"); +@@ -103,14 +103,14 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExcludedPackagesAllIgnored() throws Exception { ++ void excludedPackagesAllIgnored() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputClassFanOutComplexityExcludedPackagesAllIgnored.java"), expected); + } + + @Test +- public void test15() throws Exception { ++ void test15() throws Exception { + + final String[] expected = { + "29:1: " + getCheckMessage(MSG_KEY, 1, 0), +@@ -120,13 +120,13 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputClassFanOutComplexity2.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ClassFanOutComplexityCheck classFanOutComplexityCheckObj = + new ClassFanOutComplexityCheck(); + final int[] actual = classFanOutComplexityCheckObj.getAcceptableTokens(); +@@ -150,7 +150,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRegularExpression() throws Exception { ++ void regularExpression() throws Exception { + + final String[] expected = { + "44:1: " + getCheckMessage(MSG_KEY, 2, 0), "76:1: " + getCheckMessage(MSG_KEY, 1, 0), +@@ -160,7 +160,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyRegularExpression() throws Exception { ++ void emptyRegularExpression() throws Exception { + + final String[] expected = { + "44:1: " + getCheckMessage(MSG_KEY, 3, 0), "76:1: " + getCheckMessage(MSG_KEY, 1, 0), +@@ -170,7 +170,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithMultiDimensionalArray() throws Exception { ++ void withMultiDimensionalArray() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -178,14 +178,14 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageName() throws Exception { ++ void packageName() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputClassFanOutComplexityPackageName.java"), expected); + } + + @Test +- public void testExtends() throws Exception { ++ void testExtends() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_KEY, 1, 0), + }; +@@ -193,7 +193,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImplements() throws Exception { ++ void testImplements() throws Exception { + final String[] expected = { + "23:1: " + getCheckMessage(MSG_KEY, 1, 0), + }; +@@ -201,7 +201,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final String[] expected = { + "29:1: " + getCheckMessage(MSG_KEY, 2, 0), + "45:5: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -215,7 +215,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImplementsAndNestedCount() throws Exception { ++ void implementsAndNestedCount() throws Exception { + final String[] expected = { + "26:1: " + getCheckMessage(MSG_KEY, 3, 0), + }; +@@ -224,7 +224,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassFanOutComplexityRecords() throws Exception { ++ void classFanOutComplexityRecords() throws Exception { + final String[] expected = { + "32:1: " + getCheckMessage(MSG_KEY, 4, 2), "53:1: " + getCheckMessage(MSG_KEY, 4, 2), + }; +@@ -233,27 +233,27 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassFanOutComplexityIgnoreVar() throws Exception { ++ void classFanOutComplexityIgnoreVar() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputClassFanOutComplexityVar.java"), expected); + } + + @Test +- public void testClassFanOutComplexityRemoveIncorrectAnnotationToken() throws Exception { ++ void classFanOutComplexityRemoveIncorrectAnnotationToken() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputClassFanOutComplexityRemoveIncorrectAnnotationToken.java"), expected); + } + + @Test +- public void testClassFanOutComplexityRemoveIncorrectTypeParameter() throws Exception { ++ void classFanOutComplexityRemoveIncorrectTypeParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputClassFanOutComplexityRemoveIncorrectTypeParameter.java"), expected); + } + + @Test +- public void testClassFanOutComplexityMultiCatchBitwiseOr() throws Exception { ++ void classFanOutComplexityMultiCatchBitwiseOr() throws Exception { + final String[] expected = { + "27:1: " + getCheckMessage(MSG_KEY, 5, 4), + }; +@@ -263,7 +263,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThrows() throws Exception { ++ void testThrows() throws Exception { + final String[] expected = { + "25:1: " + getCheckMessage(MSG_KEY, 2, 0), + }; +@@ -277,9 +277,9 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + * + * @throws Exception when code tested throws exception + */ +- @Test + @SuppressWarnings("unchecked") +- public void testClearStateImportedClassPackages() throws Exception { ++ @Test ++ void clearStateImportedClassPackages() throws Exception { + final ClassFanOutComplexityCheck check = new ClassFanOutComplexityCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -293,7 +293,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- importAst.get(), ++ importAst.orElseThrow(), + "importedClassPackages", + importedClssPackage -> ((Map) importedClssPackage).isEmpty())) + .isTrue(); +@@ -306,7 +306,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testClearStateClassContexts() throws Exception { ++ void clearStateClassContexts() throws Exception { + final ClassFanOutComplexityCheck check = new ClassFanOutComplexityCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -320,7 +320,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- classDef.get(), ++ classDef.orElseThrow(), + "classesContexts", + classContexts -> ((Collection) classContexts).size() == 1)) + .isTrue(); +@@ -333,7 +333,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + * @throws Exception when code tested throws exception + */ + @Test +- public void testClearStatePackageName() throws Exception { ++ void clearStatePackageName() throws Exception { + final ClassFanOutComplexityCheck check = new ClassFanOutComplexityCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -347,7 +347,7 @@ public class ClassFanOutComplexityCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- packageDef.get(), ++ packageDef.orElseThrow(), + "packageName", + packageName -> ((String) packageName).isEmpty())) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java +index fa7f8696f..4ea586511 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/CyclomaticComplexityCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { ++final class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchBlockAsSingleDecisionPointSetToTrue() throws Exception { ++ void switchBlockAsSingleDecisionPointSetToTrue() throws Exception { + + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -45,7 +45,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchBlockAsSingleDecisionPointSetToFalse() throws Exception { ++ void switchBlockAsSingleDecisionPointSetToFalse() throws Exception { + + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, 5, 0), +@@ -55,7 +55,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsMaxComplexity() throws Exception { ++ void equalsMaxComplexity() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -63,7 +63,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + + final String[] expected = { + "15:5: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -82,7 +82,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCyclomaticComplexityRecords() throws Exception { ++ void cyclomaticComplexityRecords() throws Exception { + + final int max = 0; + +@@ -99,7 +99,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final CyclomaticComplexityCheck cyclomaticComplexityCheckObj = new CyclomaticComplexityCheck(); + final int[] actual = cyclomaticComplexityCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -123,7 +123,7 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final CyclomaticComplexityCheck cyclomaticComplexityCheckObj = new CyclomaticComplexityCheck(); + final int[] actual = cyclomaticComplexityCheckObj.getRequiredTokens(); + final int[] expected = { +@@ -137,14 +137,14 @@ public class CyclomaticComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHighMax() throws Exception { ++ void highMax() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputCyclomaticComplexitySwitchBlocks4.java"), expected); + } + + @Test +- public void testDefaultMax() throws Exception { ++ void defaultMax() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, 12, 10), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java +index f16d2c323..f87bba68c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/JavaNCSSCheckTest.java +@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; + + /** Test case for the JavaNCSS-Check. */ + // -@cs[AbbreviationAsWordInName] Test should be named as its main class. +-public class JavaNCSSCheckTest extends AbstractModuleTestSupport { ++final class JavaNCSSCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test() throws Exception { ++ void test() throws Exception { + + final String[] expected = { + "12:1: " + getCheckMessage(MSG_FILE, 39, 2), +@@ -62,7 +62,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualToMax() throws Exception { ++ void equalToMax() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -70,13 +70,13 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJavaNCSS3.java"), expected); + } + + @Test +- public void testRecordsAndCompactCtors() throws Exception { ++ void recordsAndCompactCtors() throws Exception { + + final String[] expected = { + "12:1: " + getCheckMessage(MSG_FILE, 89, 2), +@@ -99,7 +99,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForMutation() throws Exception { ++ void forMutation() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_CLASS, 84, 80), "16:5: " + getCheckMessage(MSG_CLASS, 83, 80), + }; +@@ -107,7 +107,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordMax() throws Exception { ++ void recordMax() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_CLASS, 152, 80), + "15:5: " + getCheckMessage(MSG_RECORD, 151, 150), +@@ -117,7 +117,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final JavaNCSSCheck javaNcssCheckObj = new JavaNCSSCheck(); + final int[] actual = javaNcssCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -157,7 +157,7 @@ public class JavaNCSSCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final JavaNCSSCheck javaNcssCheckObj = new JavaNCSSCheck(); + final int[] actual = javaNcssCheckObj.getRequiredTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java +index d8dbedadc..ca3367ee8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/metrics/NPathComplexityCheckTest.java +@@ -40,7 +40,7 @@ import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + + // -@cs[AbbreviationAsWordInName] Can't change check name +-public class NPathComplexityCheckTest extends AbstractModuleTestSupport { ++final class NPathComplexityCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -48,7 +48,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCalculation() throws Exception { ++ void calculation() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, 2, 0), + "17:17: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -70,7 +70,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCalculation2() throws Exception { ++ void calculation2() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, 5, 0), + "18:5: " + getCheckMessage(MSG_KEY, 5, 0), +@@ -92,7 +92,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCalculation3() throws Exception { ++ void calculation3() throws Exception { + final String[] expected = { + "11:5: " + getCheckMessage(MSG_KEY, 64, 0), + }; +@@ -102,7 +102,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIntegerOverflow() throws Exception { ++ void integerOverflow() throws Exception { + + final long largerThanMaxInt = 3_486_784_401L; + +@@ -113,9 +113,9 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + verifyWithInlineConfigParser(getPath("InputNPathComplexityOverflow.java"), expected); + } + +- @Test + @SuppressWarnings("unchecked") +- public void testStatefulFieldsClearedOnBeginTree1() { ++ @Test ++ void statefulFieldsClearedOnBeginTree1() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(TokenTypes.LITERAL_ELSE); + +@@ -151,9 +151,9 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + .isTrue(); + } + +- @Test + @SuppressWarnings("unchecked") +- public void testStatefulFieldsClearedOnBeginTree2() { ++ @Test ++ void statefulFieldsClearedOnBeginTree2() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(TokenTypes.LITERAL_RETURN); + ast.setLineNo(5); +@@ -173,7 +173,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStatefulFieldsClearedOnBeginTree3() throws Exception { ++ void statefulFieldsClearedOnBeginTree3() throws Exception { + final NPathComplexityCheck check = new NPathComplexityCheck(); + final Optional question = + TestUtil.findTokenInAstByPredicate( +@@ -188,7 +188,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- question.get(), ++ question.orElseThrow(), + "processingTokenEnd", + processingTokenEnd -> { + return TestUtil.getInternalState(processingTokenEnd, "endLineNo") == 0 +@@ -198,13 +198,13 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNPathComplexityDefault2.java"), expected); + } + + @Test +- public void testNpathComplexityRecords() throws Exception { ++ void npathComplexityRecords() throws Exception { + final int max = 1; + + final String[] expected = { +@@ -219,7 +219,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNpathComplexitySwitchExpression() throws Exception { ++ void npathComplexitySwitchExpression() throws Exception { + + final int max = 1; + +@@ -235,7 +235,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBranchVisited() throws Exception { ++ void branchVisited() throws Exception { + + final String[] expected = { + "13:3: " + getCheckMessage(MSG_KEY, 37, 20), +@@ -245,7 +245,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCount() throws Exception { ++ void count() throws Exception { + + final String[] expected = { + "11:5: " + getCheckMessage(MSG_KEY, 30, 20), +@@ -257,7 +257,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final NPathComplexityCheck npathComplexityCheckObj = new NPathComplexityCheck(); + final int[] actual = npathComplexityCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -285,7 +285,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final NPathComplexityCheck npathComplexityCheckObj = new NPathComplexityCheck(); + final int[] actual = npathComplexityCheckObj.getRequiredTokens(); + final int[] expected = { +@@ -313,7 +313,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultHooks() { ++ void defaultHooks() { + final NPathComplexityCheck npathComplexityCheckObj = new NPathComplexityCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.INTERFACE_DEF, "interface")); +@@ -341,7 +341,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + * @throws Exception if there is an error. + */ + @Test +- public void testTokenEndIsAfterSameLineColumn() throws Exception { ++ void tokenEndIsAfterSameLineColumn() throws Exception { + final NPathComplexityCheck check = new NPathComplexityCheck(); + final Object tokenEnd = TestUtil.getInternalState(check, "processingTokenEnd"); + final DetailAstImpl token = new DetailAstImpl(); +@@ -354,7 +354,7 @@ public class NPathComplexityCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitTokenBeforeExpressionRange() { ++ void visitTokenBeforeExpressionRange() { + // Create first ast + final DetailAstImpl astIf = mockAST(TokenTypes.LITERAL_IF, "if", 2, 2); + final DetailAstImpl astIfLeftParen = mockAST(TokenTypes.LPAREN, "(", 3, 3); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ClassMemberImpliedModifierCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ClassMemberImpliedModifierCheckTest.java +index 5de3189b9..9896c8106 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ClassMemberImpliedModifierCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ClassMemberImpliedModifierCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { ++final class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testMethodsOnClass() throws Exception { ++ void methodsOnClass() throws Exception { + final String[] expected = { + "51:9: " + getCheckMessage(MSG_KEY, "static"), + "58:9: " + getCheckMessage(MSG_KEY, "static"), +@@ -49,7 +49,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ClassMemberImpliedModifierCheck check = new ClassMemberImpliedModifierCheck(); + final int[] actual = check.getRequiredTokens(); + final int[] expected = { +@@ -59,7 +59,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testMethodsOnClassNoImpliedStaticEnum() throws Exception { ++ void methodsOnClassNoImpliedStaticEnum() throws Exception { + final String[] expected = { + "59:9: " + getCheckMessage(MSG_KEY, "static"), + "77:9: " + getCheckMessage(MSG_KEY, "static"), +@@ -70,7 +70,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testMethodsOnClassNoImpliedStaticInterface() throws Exception { ++ void methodsOnClassNoImpliedStaticInterface() throws Exception { + final String[] expected = { + "52:9: " + getCheckMessage(MSG_KEY, "static"), + "63:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -81,14 +81,14 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testMethodsOnClassNoViolationsChecked() throws Exception { ++ void methodsOnClassNoViolationsChecked() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputClassMemberImpliedModifierOnClassNoViolations.java"), expected); + } + + @Test +- public void testMethodsOnInterface() throws Exception { ++ void methodsOnInterface() throws Exception { + final String[] expected = { + "60:13: " + getCheckMessage(MSG_KEY, "static"), + "67:13: " + getCheckMessage(MSG_KEY, "static"), +@@ -102,7 +102,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testClassMemberImpliedModifierRecords() throws Exception { ++ void classMemberImpliedModifierRecords() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY, "static"), + "20:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -117,7 +117,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testClassMemberImpliedModifierNoViolationRecords() throws Exception { ++ void classMemberImpliedModifierNoViolationRecords() throws Exception { + final String[] expected = { + "16:5: " + getCheckMessage(MSG_KEY, "static"), + "20:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -129,7 +129,7 @@ public class ClassMemberImpliedModifierCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testIllegalState() { ++ void illegalState() { + final DetailAstImpl init = new DetailAstImpl(); + init.setType(TokenTypes.STATIC_INIT); + final DetailAstImpl objBlock = new DetailAstImpl(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/InterfaceMemberImpliedModifierCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/InterfaceMemberImpliedModifierCheckTest.java +index f79d51735..2c69ac756 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/InterfaceMemberImpliedModifierCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/InterfaceMemberImpliedModifierCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { ++final class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testMethodsOnInterfaceNoImpliedPublicAbstract() throws Exception { ++ void methodsOnInterfaceNoImpliedPublicAbstract() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_KEY, "public"), + "27:5: " + getCheckMessage(MSG_KEY, "public"), +@@ -50,7 +50,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final InterfaceMemberImpliedModifierCheck check = new InterfaceMemberImpliedModifierCheck(); + final int[] actual = check.getRequiredTokens(); + final int[] expected = { +@@ -64,7 +64,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testMethodsOnInterfaceNoImpliedAbstractAllowImpliedPublic() throws Exception { ++ void methodsOnInterfaceNoImpliedAbstractAllowImpliedPublic() throws Exception { + final String[] expected = { + "36:5: " + getCheckMessage(MSG_KEY, "abstract"), + "38:5: " + getCheckMessage(MSG_KEY, "abstract"), +@@ -74,7 +74,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testMethodsOnInterfaceNoImpliedPublicAllowImpliedAbstract() throws Exception { ++ void methodsOnInterfaceNoImpliedPublicAllowImpliedAbstract() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_KEY, "public"), + "27:5: " + getCheckMessage(MSG_KEY, "public"), +@@ -86,21 +86,21 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testMethodsOnInterfaceAllowImpliedPublicAbstract() throws Exception { ++ void methodsOnInterfaceAllowImpliedPublicAbstract() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputInterfaceMemberImpliedModifierMethodsOnInterface4.java"), expected); + } + + @Test +- public void testMethodsOnClassIgnored() throws Exception { ++ void methodsOnClassIgnored() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputInterfaceMemberImpliedModifierMethodsOnClass.java"), expected); + } + + @Test +- public void testMethodsOnInterfaceNestedNoImpliedPublicAbstract() throws Exception { ++ void methodsOnInterfaceNestedNoImpliedPublicAbstract() throws Exception { + final String[] expected = { + "23:9: " + getCheckMessage(MSG_KEY, "public"), + "29:9: " + getCheckMessage(MSG_KEY, "public"), +@@ -114,7 +114,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testMethodsOnClassNestedNoImpliedPublicAbstract() throws Exception { ++ void methodsOnClassNestedNoImpliedPublicAbstract() throws Exception { + final String[] expected = { + "23:9: " + getCheckMessage(MSG_KEY, "public"), + "29:9: " + getCheckMessage(MSG_KEY, "public"), +@@ -128,7 +128,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testFieldsOnInterfaceNoImpliedPublicStaticFinal() throws Exception { ++ void fieldsOnInterfaceNoImpliedPublicStaticFinal() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_KEY, "final"), + "22:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -148,7 +148,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testFieldsOnInterfaceNoImpliedPublicStaticAllowImpliedFinal() throws Exception { ++ void fieldsOnInterfaceNoImpliedPublicStaticAllowImpliedFinal() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_KEY, "static"), + "24:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -164,7 +164,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testFieldsOnInterfaceNoImpliedPublicFinalAllowImpliedStatic() throws Exception { ++ void fieldsOnInterfaceNoImpliedPublicFinalAllowImpliedStatic() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_KEY, "final"), + "24:5: " + getCheckMessage(MSG_KEY, "final"), +@@ -180,7 +180,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testFieldsOnInterfaceNoImpliedStaticFinalAllowImpliedPublic() throws Exception { ++ void fieldsOnInterfaceNoImpliedStaticFinalAllowImpliedPublic() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_KEY, "final"), + "22:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -196,21 +196,21 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testFieldsOnInterfaceAllowImpliedPublicStaticFinal() throws Exception { ++ void fieldsOnInterfaceAllowImpliedPublicStaticFinal() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputInterfaceMemberImpliedModifierFieldsOnInterface5.java"), expected); + } + + @Test +- public void testFieldsOnClassIgnored() throws Exception { ++ void fieldsOnClassIgnored() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputInterfaceMemberImpliedModifierFieldsOnClass.java"), expected); + } + + @Test +- public void testNestedOnInterfaceNoImpliedPublicStatic() throws Exception { ++ void nestedOnInterfaceNoImpliedPublicStatic() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_KEY, "static"), + "24:5: " + getCheckMessage(MSG_KEY, "public"), +@@ -230,7 +230,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testNestedOnInterfaceNoImpliedStaticAllowImpliedPublic() throws Exception { ++ void nestedOnInterfaceNoImpliedStaticAllowImpliedPublic() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_KEY, "static"), + "27:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -244,7 +244,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testNestedOnInterfaceNoImpliedPublicAllowImpliedStatic() throws Exception { ++ void nestedOnInterfaceNoImpliedPublicAllowImpliedStatic() throws Exception { + final String[] expected = { + "24:5: " + getCheckMessage(MSG_KEY, "public"), + "27:5: " + getCheckMessage(MSG_KEY, "public"), +@@ -258,21 +258,21 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testNestedOnInterfaceAllowImpliedPublicStatic() throws Exception { ++ void nestedOnInterfaceAllowImpliedPublicStatic() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputInterfaceMemberImpliedModifierNestedOnInterface4.java"), expected); + } + + @Test +- public void testNestedOnClassIgnored() throws Exception { ++ void nestedOnClassIgnored() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputInterfaceMemberImpliedModifierNestedOnClass.java"), expected); + } + + @Test +- public void testNestedOnInterfaceNestedNoImpliedPublicStatic() throws Exception { ++ void nestedOnInterfaceNestedNoImpliedPublicStatic() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(MSG_KEY, "public"), + "20:9: " + getCheckMessage(MSG_KEY, "static"), +@@ -286,7 +286,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testNestedOnClassNestedNoImpliedPublicStatic() throws Exception { ++ void nestedOnClassNestedNoImpliedPublicStatic() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(MSG_KEY, "public"), + "20:9: " + getCheckMessage(MSG_KEY, "static"), +@@ -300,7 +300,7 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testPackageScopeInterface() throws Exception { ++ void packageScopeInterface() throws Exception { + final String[] expected = { + "20:5: " + getCheckMessage(MSG_KEY, "final"), + "22:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -330,14 +330,14 @@ public class InterfaceMemberImpliedModifierCheckTest extends AbstractModuleTestS + } + + @Test +- public void testPrivateMethodsOnInterface() throws Exception { ++ void privateMethodsOnInterface() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputInterfaceMemberImpliedModifierPrivateMethods.java"), expected); + } + + @Test +- public void testIllegalState() { ++ void illegalState() { + final DetailAstImpl init = new DetailAstImpl(); + init.setType(TokenTypes.STATIC_INIT); + final DetailAstImpl objBlock = new DetailAstImpl(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java +index acaba5e92..d8fff14f0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/ModifierOrderCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class ModifierOrderCheckTest extends AbstractModuleTestSupport { ++final class ModifierOrderCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ModifierOrderCheck checkObj = new ModifierOrderCheck(); + final int[] expected = {TokenTypes.MODIFIERS}; + assertWithMessage("Default required tokens are invalid") +@@ -45,7 +45,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "15:10: " + getCheckMessage(MSG_MODIFIER_ORDER, "final"), + "19:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), +@@ -59,13 +59,13 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultMethods() throws Exception { ++ void defaultMethods() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputModifierOrderDefaultMethods.java"), expected); + } + + @Test +- public void testGetDefaultTokens() { ++ void getDefaultTokens() { + final ModifierOrderCheck modifierOrderCheckObj = new ModifierOrderCheck(); + final int[] actual = modifierOrderCheckObj.getDefaultTokens(); + final int[] expected = {TokenTypes.MODIFIERS}; +@@ -82,7 +82,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ModifierOrderCheck modifierOrderCheckObj = new ModifierOrderCheck(); + final int[] actual = modifierOrderCheckObj.getAcceptableTokens(); + final int[] expected = {TokenTypes.MODIFIERS}; +@@ -99,7 +99,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipTypeAnnotations() throws Exception { ++ void skipTypeAnnotations() throws Exception { + final String[] expected = { + "110:13: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@MethodAnnotation"), + }; +@@ -107,7 +107,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationOnAnnotationDeclaration() throws Exception { ++ void annotationOnAnnotationDeclaration() throws Exception { + final String[] expected = { + "9:8: " + getCheckMessage(MSG_ANNOTATION_ORDER, "@InterfaceAnnotation"), + }; +@@ -115,7 +115,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testModifierOrderSealedAndNonSealed() throws Exception { ++ void modifierOrderSealedAndNonSealed() throws Exception { + final String[] expected = { + "10:8: " + getCheckMessage(MSG_MODIFIER_ORDER, "public"), + "26:12: " + getCheckMessage(MSG_MODIFIER_ORDER, "private"), +@@ -129,7 +129,7 @@ public class ModifierOrderCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testModifierOrderSealedAndNonSealedNoViolation() throws Exception { ++ void modifierOrderSealedAndNonSealedNoViolation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputModifierOrderSealedAndNonSealedNoViolation.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java +index 4f5a6e7a3..68e3bf4e6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/modifier/RedundantModifierCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class RedundantModifierCheckTest extends AbstractModuleTestSupport { ++final class RedundantModifierCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassesInsideOfInterfaces() throws Exception { ++ void classesInsideOfInterfaces() throws Exception { + final String[] expected = { + "19:5: " + getCheckMessage(MSG_KEY, "static"), + "25:5: " + getCheckMessage(MSG_KEY, "public"), +@@ -49,7 +49,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "57:12: " + getCheckMessage(MSG_KEY, "static"), + "60:9: " + getCheckMessage(MSG_KEY, "public"), +@@ -70,14 +70,14 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStaticMethodInInterface() throws Exception { ++ void staticMethodInInterface() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRedundantModifierStaticMethodInInterface.java"), expected); + } + + @Test +- public void testFinalInInterface() throws Exception { ++ void finalInInterface() throws Exception { + final String[] expected = { + "13:9: " + getCheckMessage(MSG_KEY, "final"), + }; +@@ -85,7 +85,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumConstructorIsImplicitlyPrivate() throws Exception { ++ void enumConstructorIsImplicitlyPrivate() throws Exception { + final String[] expected = { + "14:5: " + getCheckMessage(MSG_KEY, "private"), + }; +@@ -94,7 +94,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerTypeInInterfaceIsImplicitlyStatic() throws Exception { ++ void innerTypeInInterfaceIsImplicitlyStatic() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, "static"), "16:5: " + getCheckMessage(MSG_KEY, "static"), + }; +@@ -103,7 +103,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotPublicClassConstructorHasNotPublicModifier() throws Exception { ++ void notPublicClassConstructorHasNotPublicModifier() throws Exception { + + final String[] expected = { + "22:5: " + getCheckMessage(MSG_KEY, "public"), +@@ -113,7 +113,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNestedClassConsInPublicInterfaceHasValidPublicModifier() throws Exception { ++ void nestedClassConsInPublicInterfaceHasValidPublicModifier() throws Exception { + + final String[] expected = { + "22:17: " + getCheckMessage(MSG_KEY, "public"), +@@ -129,7 +129,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final RedundantModifierCheck redundantModifierCheckObj = new RedundantModifierCheck(); + final int[] actual = redundantModifierCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -148,7 +148,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongTokenType() { ++ void wrongTokenType() { + final RedundantModifierCheck obj = new RedundantModifierCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(TokenTypes.LITERAL_NULL, "null"); +@@ -167,7 +167,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final RedundantModifierCheck redundantModifierCheckObj = new RedundantModifierCheck(); + final int[] actual = redundantModifierCheckObj.getRequiredTokens(); + final int[] expected = CommonUtil.EMPTY_INT_ARRAY; +@@ -175,7 +175,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNestedStaticEnum() throws Exception { ++ void nestedStaticEnum() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, "static"), + "16:9: " + getCheckMessage(MSG_KEY, "static"), +@@ -186,7 +186,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalInAnonymousClass() throws Exception { ++ void finalInAnonymousClass() throws Exception { + final String[] expected = { + "22:20: " + getCheckMessage(MSG_KEY, "final"), + }; +@@ -195,7 +195,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalInTryWithResource() throws Exception { ++ void finalInTryWithResource() throws Exception { + final String[] expected = { + "38:14: " + getCheckMessage(MSG_KEY, "final"), + "43:14: " + getCheckMessage(MSG_KEY, "final"), +@@ -206,7 +206,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFinalInAbstractMethods() throws Exception { ++ void finalInAbstractMethods() throws Exception { + final String[] expected = { + "12:33: " + getCheckMessage(MSG_KEY, "final"), + "16:49: " + getCheckMessage(MSG_KEY, "final"), +@@ -219,7 +219,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumMethods() throws Exception { ++ void enumMethods() throws Exception { + final String[] expected = { + "15:16: " + getCheckMessage(MSG_KEY, "final"), "30:16: " + getCheckMessage(MSG_KEY, "final"), + }; +@@ -228,7 +228,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumStaticMethodsInPublicClass() throws Exception { ++ void enumStaticMethodsInPublicClass() throws Exception { + final String[] expected = { + "20:23: " + getCheckMessage(MSG_KEY, "final"), + }; +@@ -237,7 +237,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationOnEnumConstructor() throws Exception { ++ void annotationOnEnumConstructor() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_KEY, "private"), + }; +@@ -246,7 +246,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPrivateMethodInPrivateClass() throws Exception { ++ void privateMethodInPrivateClass() throws Exception { + final String[] expected = { + "13:17: " + getCheckMessage(MSG_KEY, "final"), + }; +@@ -255,7 +255,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResourcesBlock() throws Exception { ++ void tryWithResourcesBlock() throws Exception { + final String[] expected = { + "18:19: " + getCheckMessage(MSG_KEY, "final"), + }; +@@ -263,7 +263,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNestedDef() throws Exception { ++ void nestedDef() throws Exception { + final String[] expected = { + "10:5: " + getCheckMessage(MSG_KEY, "public"), + "11:5: " + getCheckMessage(MSG_KEY, "static"), +@@ -293,7 +293,7 @@ public class RedundantModifierCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecords() throws Exception { ++ void records() throws Exception { + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, "static"), + "16:9: " + getCheckMessage(MSG_KEY, "final"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java +index 05de01ba1..bee5e6901 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbbreviationAsWordInNameCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport { ++final class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final int expectedCapitalCount = 4; + + final String[] expected = { +@@ -51,7 +51,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeNamesForThreePermittedCapitalLetters() throws Exception { ++ void typeNamesForThreePermittedCapitalLetters() throws Exception { + final int expectedCapitalCount = 4; + + final String[] expected = { +@@ -65,7 +65,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeNamesForFourPermittedCapitalLetters() throws Exception { ++ void typeNamesForFourPermittedCapitalLetters() throws Exception { + final int expectedCapitalCount = 5; + + final String[] expected = { +@@ -76,7 +76,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeNamesForFivePermittedCapitalLetters() throws Exception { ++ void typeNamesForFivePermittedCapitalLetters() throws Exception { + final int expectedCapitalCount = 6; + final String[] expected = { + "45:11: " + getWarningMessage("AbstractINNERRClass", expectedCapitalCount), +@@ -87,7 +87,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNames() throws Exception { ++ void typeAndVariablesAndMethodNames() throws Exception { + final int expectedCapitalCount = 6; + + final String[] expected = { +@@ -102,7 +102,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithNoIgnores() throws Exception { ++ void typeAndVariablesAndMethodNamesWithNoIgnores() throws Exception { + final int expectedCapitalCount = 6; + + final String[] expected = { +@@ -122,7 +122,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithIgnores() throws Exception { ++ void typeAndVariablesAndMethodNamesWithIgnores() throws Exception { + final int expectedCapitalCount = 6; + + final String[] expected = { +@@ -138,7 +138,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithIgnoresFinal() throws Exception { ++ void typeAndVariablesAndMethodNamesWithIgnoresFinal() throws Exception { + final int expectedCapitalCount = 5; + + final String[] expected = { +@@ -155,7 +155,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithIgnoresStatic() throws Exception { ++ void typeAndVariablesAndMethodNamesWithIgnoresStatic() throws Exception { + final int expectedCapitalCount = 5; + + final String[] expected = { +@@ -172,7 +172,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithIgnoresStaticFinal() throws Exception { ++ void typeAndVariablesAndMethodNamesWithIgnoresStaticFinal() throws Exception { + final int expectedCapitalCount = 5; + + final String[] expected = { +@@ -190,7 +190,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithIgnoresNonStaticFinal() throws Exception { ++ void typeAndVariablesAndMethodNamesWithIgnoresNonStaticFinal() throws Exception { + final int expectedCapitalCount = 5; + + final String[] expected = { +@@ -219,7 +219,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithIgnoresFinalKeepStaticFinal() throws Exception { ++ void typeAndVariablesAndMethodNamesWithIgnoresFinalKeepStaticFinal() throws Exception { + final int expectedCapitalCount = 5; + + final String[] expected = { +@@ -242,8 +242,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeAndVariablesAndMethodNamesWithIgnoresStaticKeepStaticFinal() +- throws Exception { ++ void typeAndVariablesAndMethodNamesWithIgnoresStaticKeepStaticFinal() throws Exception { + final int expectedCapitalCount = 5; + + final String[] expected = { +@@ -266,7 +265,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeNamesForThreePermittedCapitalLettersWithOverriddenMethod() throws Exception { ++ void typeNamesForThreePermittedCapitalLettersWithOverriddenMethod() throws Exception { + final int expectedCapitalCount = 4; + + final String[] expected = { +@@ -278,7 +277,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testOverriddenMethod() throws Exception { ++ void overriddenMethod() throws Exception { + final int expectedCapitalCount = 4; + + final String[] expected = { +@@ -293,7 +292,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testTypeNamesForZeroPermittedCapitalLetter() throws Exception { ++ void typeNamesForZeroPermittedCapitalLetter() throws Exception { + final int expectedCapitalCount = 1; + final String[] expected = { + "20:16: " + getWarningMessage("NonAAAAbstractClassName6", expectedCapitalCount), +@@ -329,7 +328,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testNullPointerException() throws Exception { ++ void nullPointerException() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -338,7 +337,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testAbbreviationAsWordInNameCheckEnhancedInstanceof() throws Exception { ++ void abbreviationAsWordInNameCheckEnhancedInstanceof() throws Exception { + + final int expectedCapitalCount = 4; + +@@ -355,8 +354,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testAbbreviationAsWordInNameCheckEnhancedInstanceofAllowXmlLength1() +- throws Exception { ++ void abbreviationAsWordInNameCheckEnhancedInstanceofAllowXmlLength1() throws Exception { + + final int expectedCapitalCount = 2; + +@@ -375,7 +373,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testAbbreviationAsWordInNameCheckRecords() throws Exception { ++ void abbreviationAsWordInNameCheckRecords() throws Exception { + + final int expectedCapitalCount = 4; + +@@ -406,14 +404,14 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testReceiver() throws Exception { ++ void receiver() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputAbbreviationAsWordInNameReceiver.java"), expected); + } + + @Test +- public void testInputAbbreviationAsWordInNameTypeSnakeStyle() throws Exception { ++ void inputAbbreviationAsWordInNameTypeSnakeStyle() throws Exception { + final String[] expected = { + "13:20: " + getWarningMessage("FLAG_IS_FIRST_RUN", 4), + "16:17: " + getWarningMessage("HYBRID_LOCK_PATH", 4), +@@ -431,7 +429,7 @@ public class AbbreviationAsWordInNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testAnnotation() throws Exception { ++ void annotation() throws Exception { + final String[] expected = { + "16:12: " + getWarningMessage("readMETHOD", 4), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java +index dcbcabe86..b6eb1cc8f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { ++final class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalAbstractClassName() throws Exception { ++ void illegalAbstractClassName() throws Exception { + + final String pattern = "^Abstract.+$"; + +@@ -50,7 +50,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomFormat() throws Exception { ++ void customFormat() throws Exception { + + final String[] expected = { + "13:1: " +@@ -68,7 +68,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalClassType() throws Exception { ++ void illegalClassType() throws Exception { + + final String[] expected = { + "18:1: " + getCheckMessage(MSG_NO_ABSTRACT_CLASS_MODIFIER, "AbstractClassType"), +@@ -79,7 +79,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllVariants() throws Exception { ++ void allVariants() throws Exception { + + final String pattern = "^Abstract.+$"; + +@@ -99,7 +99,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFalsePositive() throws Exception { ++ void falsePositive() throws Exception { + final String pattern = "^Abstract.+$"; + final String[] expected = { + "13:1: " +@@ -118,7 +118,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AbstractClassNameCheck classNameCheckObj = new AbstractClassNameCheck(); + final int[] actual = classNameCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -128,7 +128,7 @@ public class AbstractClassNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AbstractClassNameCheck classNameCheckObj = new AbstractClassNameCheck(); + final int[] actual = classNameCheckObj.getRequiredTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AccessModifierOptionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AccessModifierOptionTest.java +index 4ca35c8cf..564f1765c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AccessModifierOptionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/AccessModifierOptionTest.java +@@ -23,10 +23,10 @@ import static com.google.common.truth.Truth.assertWithMessage; + + import org.junit.jupiter.api.Test; + +-public class AccessModifierOptionTest { ++final class AccessModifierOptionTest { + + @Test +- public void testDefaultCase() { ++ void defaultCase() { + assertWithMessage("Case mismatch.") + .that(AccessModifierOption.PUBLIC.name()) + .isEqualTo("PUBLIC"); +@@ -42,7 +42,7 @@ public class AccessModifierOptionTest { + } + + @Test +- public void testCase() { ++ void testCase() { + assertWithMessage("Case mismatch.") + .that(AccessModifierOption.PUBLIC.toString()) + .isEqualTo("public"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java +index 75181c27e..ce5b50405 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/CatchParameterNameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { ++final class CatchParameterNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTokens() { ++ void tokens() { + final CatchParameterNameCheck catchParameterNameCheck = new CatchParameterNameCheck(); + final int[] expected = {TokenTypes.PARAMETER_DEF}; + +@@ -48,14 +48,14 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfigurationOnCorrectFile() throws Exception { ++ void defaultConfigurationOnCorrectFile() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputCatchParameterNameSimple.java"), expected); + } + + @Test +- public void testDefaultConfigurationOnFileWithViolations() throws Exception { ++ void defaultConfigurationOnFileWithViolations() throws Exception { + final String defaultFormat = "^(e|t|ex|[a-z][a-z][a-zA-Z]+)$"; + + final String[] expected = { +@@ -73,7 +73,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomFormatFromJavadoc() throws Exception { ++ void customFormatFromJavadoc() throws Exception { + + final String[] expected = { + "13:28: " + getCheckMessage(MSG_INVALID_PATTERN, "e", "^[a-z][a-zA-Z0-9]+$"), +@@ -84,7 +84,7 @@ public class CatchParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomFormatWithNoAnchors() throws Exception { ++ void customFormatWithNoAnchors() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java +index e4cbc6939..4f6e7832b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ClassTypeParameterNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { ++final class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetClassRequiredTokens() { ++ void getClassRequiredTokens() { + final ClassTypeParameterNameCheck checkObj = new ClassTypeParameterNameCheck(); + final int[] expected = {TokenTypes.TYPE_PARAMETER}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassDefault() throws Exception { ++ void classDefault() throws Exception { + + final String pattern = "^[A-Z]$"; + +@@ -56,7 +56,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassFooName() throws Exception { ++ void classFooName() throws Exception { + + final String pattern = "^foo$"; + +@@ -68,7 +68,7 @@ public class ClassTypeParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ClassTypeParameterNameCheck typeParameterNameCheckObj = new ClassTypeParameterNameCheck(); + final int[] actual = typeParameterNameCheckObj.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java +index 82bc7ae15..3e7967bce 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ConstantNameCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class ConstantNameCheckTest extends AbstractModuleTestSupport { ++final class ConstantNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ConstantNameCheck checkObj = new ConstantNameCheck(); + final int[] expected = {TokenTypes.VARIABLE_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -46,7 +46,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalRegexp() throws Exception { ++ void illegalRegexp() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(ConstantNameCheck.class); + checkConfig.addProperty("format", "\\"); + try { +@@ -64,7 +64,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + +@@ -76,7 +76,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAccessControlTuning() throws Exception { ++ void accessControlTuning() throws Exception { + + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + +@@ -87,7 +87,7 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceAndAnnotation() throws Exception { ++ void interfaceAndAnnotation() throws Exception { + + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + +@@ -99,13 +99,13 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault1() throws Exception { ++ void default1() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputConstantName.java"), expected); + } + + @Test +- public void testIntoInterface() throws Exception { ++ void intoInterface() throws Exception { + + final String pattern = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + +@@ -123,21 +123,21 @@ public class ConstantNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIntoInterfaceExcludePublic() throws Exception { ++ void intoInterfaceExcludePublic() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputConstantNameInterfaceIgnorePublic.java"), expected); + } + + @Test +- public void testStaticMethodInInterface() throws Exception { ++ void staticMethodInInterface() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputConstantNameStaticModifierInInterface.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ConstantNameCheck constantNameCheckObj = new ConstantNameCheck(); + final int[] actual = constantNameCheckObj.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/IllegalIdentifierNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/IllegalIdentifierNameCheckTest.java +index fc1faf75c..326079239 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/IllegalIdentifierNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/IllegalIdentifierNameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { ++final class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final IllegalIdentifierNameCheck illegalIdentifierNameCheck = new IllegalIdentifierNameCheck(); + final int[] expected = { + TokenTypes.CLASS_DEF, +@@ -59,7 +59,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final IllegalIdentifierNameCheck illegalIdentifierNameCheck = new IllegalIdentifierNameCheck(); + final int[] expected = CommonUtil.EMPTY_INT_ARRAY; + +@@ -69,7 +69,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalIdentifierNameDefault() throws Exception { ++ void illegalIdentifierNameDefault() throws Exception { + + final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; + +@@ -92,7 +92,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalIdentifierNameOpenTransitive() throws Exception { ++ void illegalIdentifierNameOpenTransitive() throws Exception { + final String format = "(?i)^(?!(record|yield|var|permits|sealed|open|transitive)$).+$"; + + final String[] expected = { +@@ -116,7 +116,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalIdentifierNameParameterReceiver() throws Exception { ++ void illegalIdentifierNameParameterReceiver() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -125,7 +125,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalIdentifierNameUnderscore() throws Exception { ++ void illegalIdentifierNameUnderscore() throws Exception { + final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; + + final String[] expected = { +@@ -136,7 +136,7 @@ public class IllegalIdentifierNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalIdentifierNameLambda() throws Exception { ++ void illegalIdentifierNameLambda() throws Exception { + final String format = "(?i)^(?!(record|yield|var|permits|sealed|_)$).+$"; + + final String[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java +index e51e8a910..6e1c4924f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/InterfaceTypeParameterNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSupport { ++final class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final InterfaceTypeParameterNameCheck interfaceTypeParameterNameCheck = + new InterfaceTypeParameterNameCheck(); + final int[] expected = {TokenTypes.TYPE_PARAMETER}; +@@ -45,7 +45,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final InterfaceTypeParameterNameCheck checkObj = new InterfaceTypeParameterNameCheck(); + final int[] expected = {TokenTypes.TYPE_PARAMETER}; + assertWithMessage("Default required tokens are invalid") +@@ -54,7 +54,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testInterfaceDefault() throws Exception { ++ void interfaceDefault() throws Exception { + + final String pattern = "^[A-Z]$"; + +@@ -65,7 +65,7 @@ public class InterfaceTypeParameterNameCheckTest extends AbstractModuleTestSuppo + } + + @Test +- public void testInterfaceFooName() throws Exception { ++ void interfaceFooName() throws Exception { + + final String pattern = "^foo$"; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckTest.java +index d9aae92a5..99e2838e4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LambdaParameterNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { ++final class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final int[] expected = { + TokenTypes.LAMBDA, + }; +@@ -45,7 +45,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptableTokens() { ++ void acceptableTokens() { + final int[] expected = { + TokenTypes.LAMBDA, + }; +@@ -56,7 +56,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParametersInLambda() throws Exception { ++ void parametersInLambda() throws Exception { + + final String pattern = "^(id)|([a-z][a-z0-9][a-zA-Z0-9]+)$"; + +@@ -71,7 +71,7 @@ public class LambdaParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaParameterNameSwitchExpression() throws Exception { ++ void lambdaParameterNameSwitchExpression() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java +index bef5ea97b..b365c18e8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalFinalVariableNameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { ++final class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final LocalFinalVariableNameCheck checkObj = new LocalFinalVariableNameCheck(); + assertWithMessage( + "LocalFinalVariableNameCheck#getRequiredTokens should return empty array " +@@ -45,7 +45,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -56,7 +56,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSet() throws Exception { ++ void set() throws Exception { + + final String pattern = "[A-Z]+"; + +@@ -67,13 +67,13 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLocalFinalVariableNameInnerClass.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final LocalFinalVariableNameCheck localFinalVariableNameCheckObj = + new LocalFinalVariableNameCheck(); + final int[] actual = localFinalVariableNameCheckObj.getAcceptableTokens(); +@@ -84,7 +84,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResources() throws Exception { ++ void tryWithResources() throws Exception { + + final String pattern = "[A-Z]+"; + +@@ -99,7 +99,7 @@ public class LocalFinalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResourcesJava9() throws Exception { ++ void tryWithResourcesJava9() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java +index a1dc5aff8..4755e6f75 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/LocalVariableNameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { ++final class LocalVariableNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final LocalVariableNameCheck localVariableNameCheck = new LocalVariableNameCheck(); + final int[] expected = {TokenTypes.VARIABLE_DEF}; + +@@ -45,7 +45,7 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -59,13 +59,13 @@ public class LocalVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLocalVariableNameInnerClass.java"), expected); + } + + @Test +- public void testLoopVariables() throws Exception { ++ void loopVariables() throws Exception { + + final String pattern = "^[a-z]{2,}[a-zA-Z0-9]*$"; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java +index 83dbd81f3..1b649b314 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MemberNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class MemberNameCheckTest extends AbstractModuleTestSupport { ++final class MemberNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MemberNameCheck checkObj = new MemberNameCheck(); + final int[] expected = {TokenTypes.VARIABLE_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpecified() throws Exception { ++ void specified() throws Exception { + + final String pattern = "^m[A-Z][a-zA-Z0-9]*$"; + +@@ -55,7 +55,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -66,7 +66,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaults() throws Exception { ++ void defaults() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -80,7 +80,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnderlined() throws Exception { ++ void underlined() throws Exception { + + final String pattern = "^_[a-z]*$"; + +@@ -94,7 +94,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPublicOnly() throws Exception { ++ void publicOnly() throws Exception { + + final String pattern = "^_[a-z]*$"; + +@@ -105,7 +105,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testProtectedOnly() throws Exception { ++ void protectedOnly() throws Exception { + + final String pattern = "^_[a-z]*$"; + +@@ -116,7 +116,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageOnly() throws Exception { ++ void packageOnly() throws Exception { + + final String pattern = "^_[a-z]*$"; + +@@ -127,7 +127,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPrivateOnly() throws Exception { ++ void privateOnly() throws Exception { + + final String pattern = "^_[a-z]*$"; + +@@ -138,7 +138,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotPrivate() throws Exception { ++ void notPrivate() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -151,7 +151,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void memberNameExtended() throws Exception { ++ void memberNameExtended() throws Exception { + + final String pattern = "^[a-z][a-z0-9][a-zA-Z0-9]*$"; + +@@ -193,7 +193,7 @@ public class MemberNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MemberNameCheck memberNameCheckObj = new MemberNameCheck(); + final int[] actual = memberNameCheckObj.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java +index 30876647b..1a388eaec 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodNameCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MethodNameCheckTest extends AbstractModuleTestSupport { ++final class MethodNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MethodNameCheck checkObj = new MethodNameCheck(); + final int[] expected = {TokenTypes.METHOD_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -45,7 +45,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -56,7 +56,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodEqClass() throws Exception { ++ void methodEqClass() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -80,7 +80,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodEqClassAllow() throws Exception { ++ void methodEqClassAllow() throws Exception { + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + + final String[] expected = { +@@ -98,7 +98,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAccessTuning() throws Exception { ++ void accessTuning() throws Exception { + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + + final String[] expected = { +@@ -114,7 +114,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testForNpe() throws Exception { ++ void forNpe() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -122,7 +122,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOverriddenMethods() throws Exception { ++ void overriddenMethods() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -135,7 +135,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfacesExcludePublic() throws Exception { ++ void interfacesExcludePublic() throws Exception { + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + + final String[] expected = { +@@ -148,7 +148,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfacesExcludePrivate() throws Exception { ++ void interfacesExcludePrivate() throws Exception { + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + + final String[] expected = { +@@ -163,7 +163,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MethodNameCheck methodNameCheckObj = new MethodNameCheck(); + final int[] actual = methodNameCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -173,7 +173,7 @@ public class MethodNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordInInterfaceBody() throws Exception { ++ void recordInInterfaceBody() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java +index 45ee7cba2..e4d36c045 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/MethodTypeParameterNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport { ++final class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MethodTypeParameterNameCheck methodTypeParameterNameCheck = + new MethodTypeParameterNameCheck(); + final int[] expected = {TokenTypes.TYPE_PARAMETER}; +@@ -45,7 +45,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MethodTypeParameterNameCheck checkObj = new MethodTypeParameterNameCheck(); + final int[] expected = {TokenTypes.TYPE_PARAMETER}; + assertWithMessage("Default required tokens are invalid") +@@ -54,7 +54,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMethodDefault() throws Exception { ++ void methodDefault() throws Exception { + + final String pattern = "^[A-Z]$"; + +@@ -69,7 +69,7 @@ public class MethodTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMethodFooName() throws Exception { ++ void methodFooName() throws Exception { + + final String pattern = "^foo$"; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java +index 553c16654..7ddd7ed7b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PackageNameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class PackageNameCheckTest extends AbstractModuleTestSupport { ++final class PackageNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class PackageNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final PackageNameCheck checkObj = new PackageNameCheck(); + final int[] expected = {TokenTypes.PACKAGE_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -44,7 +44,7 @@ public class PackageNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpecified() throws Exception { ++ void specified() throws Exception { + + final String pattern = "[A-Z]+"; + +@@ -57,13 +57,13 @@ public class PackageNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputPackageNameSimple.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final PackageNameCheck packageNameCheckObj = new PackageNameCheck(); + final int[] actual = packageNameCheckObj.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java +index da97e554a..965012cdb 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/ParameterNameCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class ParameterNameCheckTest extends AbstractModuleTestSupport { ++final class ParameterNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ParameterNameCheck checkObj = new ParameterNameCheck(); + final int[] expected = {TokenTypes.PARAMETER_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -45,13 +45,13 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCatch() throws Exception { ++ void testCatch() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParameterNameCatchOnly.java"), expected); + } + + @Test +- public void testSpecified() throws Exception { ++ void specified() throws Exception { + + final String pattern = "^a[A-Z][a-zA-Z0-9]*$"; + +@@ -64,7 +64,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceInAccessModifierProperty() throws Exception { ++ void whitespaceInAccessModifierProperty() throws Exception { + final String pattern = "^h$"; + final String[] expected = { + "14:69: " + getCheckMessage(MSG_INVALID_PATTERN, "parameter1", pattern), +@@ -75,13 +75,13 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParameterName.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ParameterNameCheck parameterNameCheckObj = new ParameterNameCheck(); + final int[] actual = parameterNameCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -91,7 +91,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipMethodsWithOverrideAnnotationTrue() throws Exception { ++ void skipMethodsWithOverrideAnnotationTrue() throws Exception { + + final String pattern = "^h$"; + +@@ -108,7 +108,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSkipMethodsWithOverrideAnnotationFalse() throws Exception { ++ void skipMethodsWithOverrideAnnotationFalse() throws Exception { + + final String pattern = "^h$"; + +@@ -126,7 +126,7 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPublicAccessModifier() throws Exception { ++ void publicAccessModifier() throws Exception { + + final String pattern = "^h$"; + +@@ -142,32 +142,32 @@ public class ParameterNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsOverriddenNoNullPointerException() throws Exception { ++ void isOverriddenNoNullPointerException() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputParameterNameOverrideAnnotationNoNPE.java"), expected); + } + + @Test +- public void testReceiverParameter() throws Exception { ++ void receiverParameter() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParameterNameReceiver.java"), expected); + } + + @Test +- public void testLambdaParameterNoViolationAtAll() throws Exception { ++ void lambdaParameterNoViolationAtAll() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParameterNameLambda.java"), expected); + } + + @Test +- public void testWhitespaceInConfig() throws Exception { ++ void whitespaceInConfig() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParameterNameWhitespaceInConfig.java"), expected); + } + + @Test +- public void testSetAccessModifiers() throws Exception { ++ void setAccessModifiers() throws Exception { + final AccessModifierOption[] input = { + AccessModifierOption.PACKAGE, + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckTest.java +index 4dd30207d..7f3057af5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/PatternVariableNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { ++final class PatternVariableNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final PatternVariableNameCheck patternVariableNameCheck = new PatternVariableNameCheck(); + final int[] expected = {TokenTypes.PATTERN_VARIABLE_DEF}; + +@@ -44,7 +44,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -65,7 +65,7 @@ public class PatternVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPatternVariableNameNoSingleChar() throws Exception { ++ void patternVariableNameNoSingleChar() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]+$"; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckTest.java +index d384719ec..d83e3a1ea 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordComponentNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { ++final class RecordComponentNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetClassRequiredTokens() { ++ void getClassRequiredTokens() { + final RecordComponentNameCheck checkObj = new RecordComponentNameCheck(); + final int[] expected = {TokenTypes.RECORD_COMPONENT_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordDefault() throws Exception { ++ void recordDefault() throws Exception { + + final String pattern = "^[a-z][a-zA-Z0-9]*$"; + +@@ -58,7 +58,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassFooName() throws Exception { ++ void classFooName() throws Exception { + + final String pattern = "^[a-z0-9]+$"; + +@@ -73,7 +73,7 @@ public class RecordComponentNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final RecordComponentNameCheck typeParameterNameCheckObj = new RecordComponentNameCheck(); + final int[] actual = typeParameterNameCheckObj.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordTypeParameterNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordTypeParameterNameCheckTest.java +index 3d1675318..f64c5859f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordTypeParameterNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/RecordTypeParameterNameCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport { ++final class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testGetClassRequiredTokens() { ++ void getClassRequiredTokens() { + final RecordTypeParameterNameCheck checkObj = new RecordTypeParameterNameCheck(); + final int[] expected = {TokenTypes.TYPE_PARAMETER}; + assertWithMessage("Default required tokens are invalid") +@@ -43,7 +43,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testRecordDefault() throws Exception { ++ void recordDefault() throws Exception { + + final String pattern = "^[A-Z]$"; + +@@ -57,7 +57,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testClassFooName() throws Exception { ++ void classFooName() throws Exception { + + final String pattern = "^foo$"; + +@@ -71,7 +71,7 @@ public class RecordTypeParameterNameCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final RecordTypeParameterNameCheck typeParameterNameCheckObj = + new RecordTypeParameterNameCheck(); + final int[] actual = typeParameterNameCheckObj.getAcceptableTokens(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java +index 6c4550bdd..2f60aa4fe 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/StaticVariableNameCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class StaticVariableNameCheckTest extends AbstractModuleTestSupport { ++final class StaticVariableNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class StaticVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final StaticVariableNameCheck checkObj = new StaticVariableNameCheck(); + final int[] expected = {TokenTypes.VARIABLE_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -44,7 +44,7 @@ public class StaticVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpecified() throws Exception { ++ void specified() throws Exception { + + final String pattern = "^s[A-Z][a-zA-Z0-9]*$"; + +@@ -55,19 +55,19 @@ public class StaticVariableNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAccessTuning() throws Exception { ++ void accessTuning() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputStaticVariableName2.java"), expected); + } + + @Test +- public void testInterfaceOrAnnotationBlock() throws Exception { ++ void interfaceOrAnnotationBlock() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputStaticVariableName.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final StaticVariableNameCheck staticVariableNameCheckObj = new StaticVariableNameCheck(); + final int[] actual = staticVariableNameCheckObj.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java +index a27d31e68..ec9c20689 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/naming/TypeNameCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck.DEFAUL + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class TypeNameCheckTest extends AbstractModuleTestSupport { ++final class TypeNameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpecified() throws Exception { ++ void specified() throws Exception { + final String[] expected = { + "25:14: " + getCheckMessage(MSG_INVALID_PATTERN, "InputTypeName", "^inputHe"), + }; +@@ -41,7 +41,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "15:7: " + getCheckMessage(MSG_INVALID_PATTERN, "inputHeaderClass2", DEFAULT_PATTERN), + "17:22: " + getCheckMessage(MSG_INVALID_PATTERN, "inputHeaderInterface", DEFAULT_PATTERN), +@@ -52,7 +52,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassSpecific() throws Exception { ++ void classSpecific() throws Exception { + final String[] expected = { + "15:7: " + getCheckMessage(MSG_INVALID_PATTERN, "inputHeaderClass3", DEFAULT_PATTERN), + }; +@@ -60,7 +60,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceSpecific() throws Exception { ++ void interfaceSpecific() throws Exception { + final String[] expected = { + "17:22: " + getCheckMessage(MSG_INVALID_PATTERN, "inputHeaderInterface", DEFAULT_PATTERN), + }; +@@ -68,7 +68,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnumSpecific() throws Exception { ++ void enumSpecific() throws Exception { + final String[] expected = { + "19:17: " + getCheckMessage(MSG_INVALID_PATTERN, "inputHeaderEnum", DEFAULT_PATTERN), + }; +@@ -76,7 +76,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationSpecific() throws Exception { ++ void annotationSpecific() throws Exception { + final String[] expected = { + "21:23: " + getCheckMessage(MSG_INVALID_PATTERN, "inputHeaderAnnotation", DEFAULT_PATTERN), + }; +@@ -84,7 +84,7 @@ public class TypeNameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTypeNameRecords() throws Exception { ++ void typeNameRecords() throws Exception { + + final String[] expected = { + "23:10: " + getCheckMessage(MSG_INVALID_PATTERN, "Third_Name", DEFAULT_PATTERN), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java +index 542147e51..77a55288e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class RegexpCheckTest extends AbstractModuleTestSupport { ++final class RegexpCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final RegexpCheck regexpCheck = new RegexpCheck(); + assertWithMessage("RegexpCheck#getAcceptableTokens should return empty array by default") + .that(regexpCheck.getAcceptableTokens()) +@@ -45,7 +45,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final RegexpCheck checkObj = new RegexpCheck(); + assertWithMessage("RegexpCheck#getRequiredTokens should return empty array by default") + .that(checkObj.getRequiredTokens()) +@@ -53,13 +53,13 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredPass() throws Exception { ++ void requiredPass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSemantic.java"), expected); + } + + @Test +- public void testRequiredFail() throws Exception { ++ void requiredFail() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); + checkConfig.addProperty("format", "This\\stext is not in the file"); + final String[] expected = { +@@ -69,19 +69,19 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredNoDuplicatesPass() throws Exception { ++ void requiredNoDuplicatesPass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSemantic3.java"), expected); + } + + @Test +- public void testSetDuplicatesTrue() throws Exception { ++ void setDuplicatesTrue() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSemantic4.java"), expected); + } + + @Test +- public void testRequiredNoDuplicatesFail() throws Exception { ++ void requiredNoDuplicatesFail() throws Exception { + final String[] expected = { + "27: " + getCheckMessage(MSG_DUPLICATE_REGEXP, "Boolean x = new Boolean"), + "32: " + getCheckMessage(MSG_DUPLICATE_REGEXP, "Boolean x = new Boolean"), +@@ -90,19 +90,19 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalPass() throws Exception { ++ void illegalPass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSemantic6.java"), expected); + } + + @Test +- public void testStopEarly() throws Exception { ++ void stopEarly() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpCheckStopEarly.java"), expected); + } + + @Test +- public void testIllegalFailBelowErrorLimit() throws Exception { ++ void illegalFailBelowErrorLimit() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "^import"), + "16: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "^import"), +@@ -112,7 +112,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIllegalFailAboveErrorLimit() throws Exception { ++ void illegalFailAboveErrorLimit() throws Exception { + final String error = + "The error limit has been exceeded, " + + "the check is aborting, there may be more unreported errors."; +@@ -124,7 +124,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessagePropertyGood() throws Exception { ++ void messagePropertyGood() throws Exception { + final String[] expected = { + "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "Bad line :("), + }; +@@ -132,7 +132,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessagePropertyBad() throws Exception { ++ void messagePropertyBad() throws Exception { + final String[] expected = { + "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "System\\.(out)|(err)\\.print(ln)?\\("), + }; +@@ -140,7 +140,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessagePropertyBad2() throws Exception { ++ void messagePropertyBad2() throws Exception { + final String[] expected = { + "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "System\\.(out)|(err)\\.print(ln)?\\("), + }; +@@ -148,7 +148,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseTrue() throws Exception { ++ void ignoreCaseTrue() throws Exception { + final String[] expected = { + "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "(?i)SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), + }; +@@ -156,7 +156,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseFalse() throws Exception { ++ void ignoreCaseFalse() throws Exception { + final String[] expectedTrue = { + "77: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "(?i)SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), + }; +@@ -167,14 +167,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsCppStyle() throws Exception { ++ void ignoreCommentsCppStyle() throws Exception { + // See if the comment is removed properly + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment.java"), expected); + } + + @Test +- public void testIgnoreCommentsFalseCppStyle() throws Exception { ++ void ignoreCommentsFalseCppStyle() throws Exception { + // See if the comment is removed properly + final String[] expected = { + "16: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "don't\\suse trailing comments"), +@@ -183,14 +183,14 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsBlockStyle() throws Exception { ++ void ignoreCommentsBlockStyle() throws Exception { + // See if the comment is removed properly + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment3.java"), expected); + } + + @Test +- public void testIgnoreCommentsFalseBlockStyle() throws Exception { ++ void ignoreCommentsFalseBlockStyle() throws Exception { + final String[] expected = { + "31: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "c-style\\s1"), + }; +@@ -198,26 +198,26 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsMultipleBlockStyle() throws Exception { ++ void ignoreCommentsMultipleBlockStyle() throws Exception { + // See if a second comment on the same line is removed properly + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment5.java"), expected); + } + + @Test +- public void testIgnoreCommentsMultiLine() throws Exception { ++ void ignoreCommentsMultiLine() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment6.java"), expected); + } + + @Test +- public void testIgnoreCommentsInlineStart() throws Exception { ++ void ignoreCommentsInlineStart() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment7.java"), expected); + } + + @Test +- public void testIgnoreCommentsInlineEnd() throws Exception { ++ void ignoreCommentsInlineEnd() throws Exception { + final String[] expected = { + "34: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "int z"), + }; +@@ -225,7 +225,7 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsInlineMiddle() throws Exception { ++ void ignoreCommentsInlineMiddle() throws Exception { + final String[] expected = { + "35: " + getCheckMessage(MSG_ILLEGAL_REGEXP, "int y"), + }; +@@ -233,21 +233,21 @@ public class RegexpCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsNoSpaces() throws Exception { ++ void ignoreCommentsNoSpaces() throws Exception { + // make sure the comment is not turned into spaces + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpTrailingComment10.java"), expected); + } + + @Test +- public void testOnFileStartingWithEmptyLine() throws Exception { ++ void onFileStartingWithEmptyLine() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify(checkConfig, getPath("InputRegexpStartingWithEmptyLine.java"), expected); + } + + @Test +- public void testIgnoreCommentsCppStyleWithIllegalPatternFalse() throws Exception { ++ void ignoreCommentsCppStyleWithIllegalPatternFalse() throws Exception { + // See if the comment is removed properly + final DefaultConfiguration checkConfig = createModuleConfig(RegexpCheck.class); + checkConfig.addProperty("format", "don't use trailing comments"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java +index 5b35c5b6b..604886cd6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpMultilineCheckTest.java +@@ -24,6 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MS + import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_EXCEEDED; + import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_REGEXP_MINIMUM; + import static com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector.MSG_STACKOVERFLOW; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +@@ -36,7 +37,7 @@ import java.nio.file.Files; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + +-public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { ++final class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + + @TempDir public File temporaryFolder; + +@@ -46,7 +47,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "78: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "System\\.(out)|(err)\\.print(ln)?\\("), + }; +@@ -54,7 +55,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessageProperty() throws Exception { ++ void messageProperty() throws Exception { + final String[] expected = { + "79: " + "Bad line :(", + }; +@@ -62,7 +63,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseTrue() throws Exception { ++ void ignoreCaseTrue() throws Exception { + final String[] expected = { + "79: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), + }; +@@ -70,13 +71,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseFalse() throws Exception { ++ void ignoreCaseFalse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpMultilineSemantic4.java"), expected); + } + + @Test +- public void testIllegalFailBelowErrorLimit() throws Exception { ++ void illegalFailBelowErrorLimit() throws Exception { + final String[] expected = { + "16: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "^import"), + "17: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "^import"), +@@ -86,7 +87,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCarriageReturn() throws Exception { ++ void carriageReturn() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpMultilineCheck.class); + checkConfig.addProperty("format", "\\r"); + checkConfig.addProperty("maximum", "0"); +@@ -96,15 +97,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + }; + + final File file = File.createTempFile("junit", null, temporaryFolder); +- Files.write( +- file.toPath(), +- "first line \r\n second line \n\r third line".getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), "first line \r\n second line \n\r third line".getBytes(UTF_8)); + + verify(checkConfig, file.getPath(), expected); + } + + @Test +- public void testMaximum() throws Exception { ++ void maximum() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpMultilineCheck.class); + checkConfig.addProperty("format", "\\r"); + checkConfig.addProperty("maximum", "1"); +@@ -113,9 +112,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + }; + + final File file = File.createTempFile("junit", null, temporaryFolder); +- Files.write( +- file.toPath(), +- "first line \r\n second line \n\r third line".getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), "first line \r\n second line \n\r third line".getBytes(UTF_8)); + + verify(checkConfig, file.getPath(), expected); + } +@@ -126,16 +123,14 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + * @throws Exception some Exception + */ + @Test +- public void testStateIsBeingReset() throws Exception { ++ void stateIsBeingReset() throws Exception { + final TestLoggingReporter reporter = new TestLoggingReporter(); + final DetectorOptions detectorOptions = + DetectorOptions.newBuilder().reporter(reporter).format("\\r").maximum(1).build(); + + final MultilineDetector detector = new MultilineDetector(detectorOptions); + final File file = File.createTempFile("junit", null, temporaryFolder); +- Files.write( +- file.toPath(), +- "first line \r\n second line \n\r third line".getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), "first line \r\n second line \n\r third line".getBytes(UTF_8)); + + detector.processLines(new FileText(file, StandardCharsets.UTF_8.name())); + detector.processLines(new FileText(file, StandardCharsets.UTF_8.name())); +@@ -145,13 +140,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpMultilineSemantic6.java"), expected); + } + + @Test +- public void testNullFormat() throws Exception { ++ void nullFormat() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_EMPTY), + }; +@@ -159,7 +154,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyFormat() throws Exception { ++ void emptyFormat() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_EMPTY), + }; +@@ -167,7 +162,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoStackOverflowError() throws Exception { ++ void noStackOverflowError() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpMultilineCheck.class); + // http://madbean.com/2004/mb2004-20/ + checkConfig.addProperty("format", "(x|y)*"); +@@ -177,13 +172,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + }; + + final File file = File.createTempFile("junit", null, temporaryFolder); +- Files.write(file.toPath(), makeLargeXyString().toString().getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), makeLargeXyString().toString().getBytes(UTF_8)); + + verify(checkConfig, file.getPath(), expected); + } + + @Test +- public void testMinimum() throws Exception { ++ void minimum() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpMultilineCheck.class); + checkConfig.addProperty("format", "\\r"); + checkConfig.addProperty("minimum", "5"); +@@ -192,13 +187,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + }; + + final File file = File.createTempFile("junit", null, temporaryFolder); +- Files.write(file.toPath(), "".getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), "".getBytes(UTF_8)); + + verify(checkConfig, file.getPath(), expected); + } + + @Test +- public void testMinimumWithCustomMessage() throws Exception { ++ void minimumWithCustomMessage() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpMultilineCheck.class); + checkConfig.addProperty("format", "\\r"); + checkConfig.addProperty("minimum", "5"); +@@ -208,7 +203,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + }; + + final File file = File.createTempFile("junit", null, temporaryFolder); +- Files.write(file.toPath(), "".getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), "".getBytes(UTF_8)); + + verify(checkConfig, file.getPath(), expected); + } +@@ -221,13 +216,13 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGoodLimit() throws Exception { ++ void goodLimit() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpMultilineSemantic9.java"), expected); + } + + @Test +- public void testMultilineSupport() throws Exception { ++ void multilineSupport() throws Exception { + final String[] expected = { + "22: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "(a)bc.*def"), + }; +@@ -235,7 +230,7 @@ public class RegexpMultilineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultilineSupportNotGreedy() throws Exception { ++ void multilineSupportNotGreedy() throws Exception { + final String[] expected = { + "22: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "(a)bc.*?def"), + "24: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "(a)bc.*?def"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java +index 95794d7ba..a9a592e4e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpOnFilenameCheckTest.java +@@ -24,17 +24,17 @@ import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameChec + import static com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck.MSG_MISMATCH; + import static org.junit.jupiter.api.Assertions.assertThrows; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.FileText; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; +-import java.util.Collections; + import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; + +-public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { ++final class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -42,14 +42,14 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultConfigurationOnValidInput() throws Exception { ++ void defaultConfigurationOnValidInput() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + verify( + checkConfig, getPath("InputRegexpOnFilenameSemantic.java"), CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testDefaultProperties() throws Exception { ++ void defaultProperties() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + final String path = getPath("InputRegexpOnFilename Space.properties"); + final String[] expected = { +@@ -59,7 +59,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFileMatches() throws Exception { ++ void matchFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("fileNamePattern", ".*\\.java"); +@@ -71,7 +71,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFileNotMatches() throws Exception { ++ void matchFileNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("fileNamePattern", "BAD.*"); +@@ -80,7 +80,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatchFileMatches() throws Exception { ++ void notMatchFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "false"); + checkConfig.addProperty("fileNamePattern", ".*\\.properties"); +@@ -92,7 +92,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatchFileNotMatches() throws Exception { ++ void notMatchFileNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "false"); + checkConfig.addProperty("fileNamePattern", ".*\\.java"); +@@ -101,7 +101,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFolderMatches() throws Exception { ++ void matchFolderMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); +@@ -113,7 +113,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFolderNotMatches() throws Exception { ++ void matchFolderNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("folderPattern", "BAD.*"); +@@ -122,7 +122,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatchFolderMatches() throws Exception { ++ void notMatchFolderMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "false"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]gov[\\\\/].*"); +@@ -134,7 +134,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatchFolderNotMatches() throws Exception { ++ void notMatchFolderNotMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "false"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); +@@ -143,7 +143,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFolderAndFileMatches() throws Exception { ++ void matchFolderAndFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); +@@ -156,7 +156,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFolderAndFileNotMatchesBoth() throws Exception { ++ void matchFolderAndFileNotMatchesBoth() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("folderPattern", "BAD.*"); +@@ -166,7 +166,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFolderAndFileNotMatchesFile() throws Exception { ++ void matchFolderAndFileNotMatchesFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]resources[\\\\/].*"); +@@ -176,7 +176,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchFolderAndFileNotMatchesFolder() throws Exception { ++ void matchFolderAndFileNotMatchesFolder() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "true"); + checkConfig.addProperty("folderPattern", "BAD.*"); +@@ -186,7 +186,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatchFolderAndFileMatches() throws Exception { ++ void notMatchFolderAndFileMatches() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "false"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]com[\\\\/].*"); +@@ -199,7 +199,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatchFolderAndFileNotMatchesFolder() throws Exception { ++ void notMatchFolderAndFileNotMatchesFolder() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "false"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]javastrangefolder[\\\\/].*"); +@@ -209,7 +209,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotMatchFolderAndFileNotMatchesFile() throws Exception { ++ void notMatchFolderAndFileNotMatchesFile() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("match", "false"); + checkConfig.addProperty("folderPattern", ".*[\\\\/]govstrangefolder[\\\\/].*"); +@@ -219,7 +219,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreExtension() throws Exception { ++ void ignoreExtension() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("fileNamePattern", ".*\\.java"); + checkConfig.addProperty("ignoreFileNameExtensions", "true"); +@@ -228,7 +228,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreExtensionNoExtension() throws Exception { ++ void ignoreExtensionNoExtension() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(RegexpOnFilenameCheck.class); + checkConfig.addProperty("fileNamePattern", "\\."); + checkConfig.addProperty("ignoreFileNameExtensions", "true"); +@@ -236,7 +236,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testException() throws Exception { ++ void exception() throws Exception { + // escape character needed for testing IOException from File.getCanonicalPath on all OSes + final File file = new File(getPath("") + "\u0000" + File.separatorChar + "Test"); + final RegexpOnFilenameCheck check = new RegexpOnFilenameCheck(); +@@ -244,7 +244,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + final CheckstyleException ex = + assertThrows( + CheckstyleException.class, +- () -> check.process(file, new FileText(file, Collections.emptyList())), ++ () -> check.process(file, new FileText(file, ImmutableList.of())), + "CheckstyleException expected"); + assertWithMessage("Invalid exception message") + .that(ex) +@@ -253,7 +253,7 @@ public class RegexpOnFilenameCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithFileWithoutParent() throws Exception { ++ void withFileWithoutParent() throws Exception { + final DefaultConfiguration moduleConfig = createModuleConfig(RegexpOnFilenameCheck.class); + final String path = getPath("package-info.java"); + final File fileWithoutParent = new MockFile(path); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java +index b47ea6cbc..d2df19ed8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineCheckTest.java +@@ -31,7 +31,7 @@ import java.io.File; + import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.Test; + +-public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { ++final class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + + private static final String[] EMPTY = {}; + +@@ -41,7 +41,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "77: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "System\\.(out)|(err)\\.print(ln)?\\("), + }; +@@ -49,7 +49,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessageProperty() throws Exception { ++ void messageProperty() throws Exception { + final String[] expected = { + "78: Bad line :(", + }; +@@ -57,7 +57,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseTrue() throws Exception { ++ void ignoreCaseTrue() throws Exception { + + final String[] expected = { + "78: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), +@@ -66,13 +66,13 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseFalse() throws Exception { ++ void ignoreCaseFalse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSinglelineSemantic4.java"), expected); + } + + @Test +- public void testMinimum() throws Exception { ++ void minimum() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_REGEXP_MINIMUM, "500", "\\r"), + }; +@@ -81,7 +81,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSetMessage() throws Exception { ++ void setMessage() throws Exception { + final String[] expected = { + "1: someMessage", + }; +@@ -90,7 +90,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMaximum() throws Exception { ++ void maximum() throws Exception { + verifyWithInlineConfigParser(getPath("InputRegexpSinglelineSemantic7.java"), EMPTY); + } + +@@ -100,7 +100,7 @@ public class RegexpSinglelineCheckTest extends AbstractModuleTestSupport { + * @throws Exception some Exception + */ + @Test +- public void testStateIsBeingReset() throws Exception { ++ void stateIsBeingReset() throws Exception { + final String illegal = "System\\.(out)|(err)\\.print(ln)?\\("; + final TestLoggingReporter reporter = new TestLoggingReporter(); + final DetectorOptions detectorOptions = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java +index 33196833a..a33e40590 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/regexp/RegexpSinglelineJavaCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { ++final class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final RegexpSinglelineJavaCheck regexpSinglelineJavaCheck = new RegexpSinglelineJavaCheck(); + assertWithMessage("Default acceptable tokens are invalid") + .that(regexpSinglelineJavaCheck.getAcceptableTokens()) +@@ -43,7 +43,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final RegexpSinglelineJavaCheck checkObj = new RegexpSinglelineJavaCheck(); + assertWithMessage("Default required tokens are invalid") + .that(checkObj.getRequiredTokens()) +@@ -51,7 +51,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "77: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "System\\.(out)|(err)\\.print(ln)?\\("), + }; +@@ -59,7 +59,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessageProperty() throws Exception { ++ void messageProperty() throws Exception { + final String[] expected = { + "78: " + "Bad line :(", + }; +@@ -67,7 +67,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseTrue() throws Exception { ++ void ignoreCaseTrue() throws Exception { + final String[] expected = { + "78: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "SYSTEM\\.(OUT)|(ERR)\\.PRINT(LN)?\\("), + }; +@@ -75,13 +75,13 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCaseFalse() throws Exception { ++ void ignoreCaseFalse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSinglelineJavaSemantic4.java"), expected); + } + + @Test +- public void testIgnoreCommentsCppStyle() throws Exception { ++ void ignoreCommentsCppStyle() throws Exception { + // See if the comment is removed properly + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -89,7 +89,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsFalseCppStyle() throws Exception { ++ void ignoreCommentsFalseCppStyle() throws Exception { + // See if the comment is removed properly + final String[] expected = { + "16: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "don't\\suse trailing comments"), +@@ -99,7 +99,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsBlockStyle() throws Exception { ++ void ignoreCommentsBlockStyle() throws Exception { + // See if the comment is removed properly + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -107,7 +107,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsFalseBlockStyle() throws Exception { ++ void ignoreCommentsFalseBlockStyle() throws Exception { + final String[] expected = { + "31: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "c-style\\s1"), + }; +@@ -116,7 +116,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsMultipleBlockStyle() throws Exception { ++ void ignoreCommentsMultipleBlockStyle() throws Exception { + // See if a second comment on the same line is removed properly + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -124,21 +124,21 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsMultiLine() throws Exception { ++ void ignoreCommentsMultiLine() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRegexpSinglelineJavaTrailingComment6.java"), expected); + } + + @Test +- public void testIgnoreCommentsInlineStart() throws Exception { ++ void ignoreCommentsInlineStart() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputRegexpSinglelineJavaTrailingComment7.java"), expected); + } + + @Test +- public void testIgnoreCommentsInlineEnd() throws Exception { ++ void ignoreCommentsInlineEnd() throws Exception { + final String[] expected = { + "34: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "int z"), + }; +@@ -147,7 +147,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsInlineMiddle() throws Exception { ++ void ignoreCommentsInlineMiddle() throws Exception { + final String[] expected = { + "35: " + getCheckMessage(MSG_REGEXP_EXCEEDED, "int y"), + }; +@@ -156,7 +156,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreCommentsNoSpaces() throws Exception { ++ void ignoreCommentsNoSpaces() throws Exception { + // make sure the comment is not turned into spaces + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -164,7 +164,7 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test1371588() throws Exception { ++ void test1371588() throws Exception { + // StackOverflowError with trailing space and ignoreComments + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -172,19 +172,19 @@ public class RegexpSinglelineJavaCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExistingInDoc() throws Exception { ++ void existingInDoc() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSinglelineJavaSemantic5.java"), expected); + } + + @Test +- public void testExistingInCode() throws Exception { ++ void existingInCode() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputRegexpSinglelineJavaSemantic6.java"), expected); + } + + @Test +- public void testMissing() throws Exception { ++ void missing() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_REGEXP_MINIMUM, 1, "This\\stext is not in the file"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java +index dc30215eb..f0bd1c659 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/AnonInnerLengthCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + + /** Unit test for AnonInnerLengthCheck. */ +-public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { ++final class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final AnonInnerLengthCheck checkObj = new AnonInnerLengthCheck(); + final int[] expected = {TokenTypes.LITERAL_NEW}; + assertWithMessage("Default required tokens are invalid") +@@ -44,7 +44,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final AnonInnerLengthCheck anonInnerLengthCheckObj = new AnonInnerLengthCheck(); + final int[] actual = anonInnerLengthCheckObj.getAcceptableTokens(); + final int[] expected = {TokenTypes.LITERAL_NEW}; +@@ -53,7 +53,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "53:35: " + getCheckMessage(MSG_KEY, 21, 20), + }; +@@ -61,7 +61,7 @@ public class AnonInnerLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonDefault() throws Exception { ++ void nonDefault() throws Exception { + final String[] expected = { + "54:35: " + getCheckMessage(MSG_KEY, 21, 6), "79:35: " + getCheckMessage(MSG_KEY, 20, 6), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java +index 40d2f3857..3bc97b183 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ExecutableStatementCountCheckTest.java +@@ -32,16 +32,16 @@ import java.util.Collection; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport { ++final class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { + return "com/puppycrawl/tools/checkstyle/checks/sizes/executablestatementcount"; + } + +- @Test + @SuppressWarnings("unchecked") +- public void testStatefulFieldsClearedOnBeginTree() { ++ @Test ++ void statefulFieldsClearedOnBeginTree() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(TokenTypes.STATIC_INIT); + final ExecutableStatementCountCheck check = new ExecutableStatementCountCheck(); +@@ -56,7 +56,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMaxZero() throws Exception { ++ void maxZero() throws Exception { + + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, 3, 0), +@@ -76,7 +76,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testMethodDef() throws Exception { ++ void methodDef() throws Exception { + + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, 3, 0), +@@ -91,7 +91,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testCtorDef() throws Exception { ++ void ctorDef() throws Exception { + + final String[] expected = { + "12:5: " + getCheckMessage(MSG_KEY, 2, 0), "22:5: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -101,7 +101,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testStaticInit() throws Exception { ++ void staticInit() throws Exception { + + final String[] expected = { + "13:5: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -111,7 +111,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testInstanceInit() throws Exception { ++ void instanceInit() throws Exception { + + final String[] expected = { + "13:5: " + getCheckMessage(MSG_KEY, 2, 0), +@@ -122,7 +122,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testVisitTokenWithWrongTokenType() { ++ void visitTokenWithWrongTokenType() { + final ExecutableStatementCountCheck checkObj = new ExecutableStatementCountCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.ENUM, "ENUM")); +@@ -135,7 +135,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testLeaveTokenWithWrongTokenType() { ++ void leaveTokenWithWrongTokenType() { + final ExecutableStatementCountCheck checkObj = new ExecutableStatementCountCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.ENUM, "ENUM")); +@@ -148,7 +148,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testDefaultConfiguration() throws Exception { ++ void defaultConfiguration() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( +@@ -156,7 +156,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testExecutableStatementCountRecords() throws Exception { ++ void executableStatementCountRecords() throws Exception { + + final int max = 1; + +@@ -174,7 +174,7 @@ public class ExecutableStatementCountCheckTest extends AbstractModuleTestSupport + } + + @Test +- public void testExecutableStatementCountLambdas() throws Exception { ++ void executableStatementCountLambdas() throws Exception { + + final int max = 1; + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java +index 6327e690b..84184e099 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/FileLengthCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class FileLengthCheckTest extends AbstractModuleTestSupport { ++final class FileLengthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class FileLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAlarm() throws Exception { ++ void alarm() throws Exception { + final String[] expected = { + "1: " + getCheckMessage(MSG_KEY, 228, 20), + }; +@@ -44,25 +44,25 @@ public class FileLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAlarmDefault() throws Exception { ++ void alarmDefault() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFileLengthDefault.java"), expected); + } + + @Test +- public void testFileLengthEqualToMaxLength() throws Exception { ++ void fileLengthEqualToMaxLength() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFileLength2.java"), expected); + } + + @Test +- public void testOk() throws Exception { ++ void ok() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputFileLength3.java"), expected); + } + + @Test +- public void testArgs() throws Exception { ++ void args() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(FileLengthCheck.class); + try { + checkConfig.addProperty("max", "abc"); +@@ -79,14 +79,14 @@ public class FileLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoAlarmByExtension() throws Exception { ++ void noAlarmByExtension() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputFileLength4.java"), expected); + } + + @Test +- public void testExtensions() { ++ void extensions() { + final FileLengthCheck check = new FileLengthCheck(); + check.setFileExtensions("java"); + assertWithMessage("extension should be the same") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthCheckTest.java +index 1b141213e..fb2f20302 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LambdaBodyLengthCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { ++final class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final LambdaBodyLengthCheck checkObj = new LambdaBodyLengthCheck(); + final int[] expected = {TokenTypes.LAMBDA}; + assertWithMessage("Default required tokens are invalid") +@@ -44,7 +44,7 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final LambdaBodyLengthCheck lambdaBodyLengthCheckObj = new LambdaBodyLengthCheck(); + final int[] actual = lambdaBodyLengthCheckObj.getAcceptableTokens(); + final int[] expected = {TokenTypes.LAMBDA}; +@@ -53,7 +53,7 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "16:27: " + getCheckMessage(MSG_KEY, 12, 10), + "28:27: " + getCheckMessage(MSG_KEY, 12, 10), +@@ -66,14 +66,14 @@ public class LambdaBodyLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultSwitchExpressions() throws Exception { ++ void defaultSwitchExpressions() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputLambdaBodyLengthSwitchExps.java"), expected); + } + + @Test +- public void testMaxLimitIsDifferent() throws Exception { ++ void maxLimitIsDifferent() throws Exception { + final String[] expected = { + "16:27: " + getCheckMessage(MSG_KEY, 4, 3), + "20:27: " + getCheckMessage(MSG_KEY, 4, 3), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java +index 01b73c424..09423227b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/LineLengthCheckTest.java +@@ -24,7 +24,7 @@ import static com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck.MSG_K + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class LineLengthCheckTest extends AbstractModuleTestSupport { ++final class LineLengthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + final String[] expected = { + "22: " + getCheckMessage(MSG_KEY, 80, 81), "149: " + getCheckMessage(MSG_KEY, 80, 83), + }; +@@ -40,7 +40,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void shouldLogActualLineLength() throws Exception { ++ void shouldLogActualLineLength() throws Exception { + final String[] expected = { + "23: 80,81", "150: 80,83", + }; +@@ -48,7 +48,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void shouldNotLogLongImportStatements() throws Exception { ++ void shouldNotLogLongImportStatements() throws Exception { + final String[] expected = { + "18: " + getCheckMessage(MSG_KEY, 80, 100), + }; +@@ -56,7 +56,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void shouldNotLogLongPackageStatements() throws Exception { ++ void shouldNotLogLongPackageStatements() throws Exception { + final String[] expected = { + "17: " + getCheckMessage(MSG_KEY, 80, 100), + }; +@@ -65,7 +65,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void shouldNotLogLongLinks() throws Exception { ++ void shouldNotLogLongLinks() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_KEY, 80, 111), + }; +@@ -73,7 +73,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void countUnicodePointsOnce() throws Exception { ++ void countUnicodePointsOnce() throws Exception { + final String[] expected = { + "15: " + getCheckMessage(MSG_KEY, 100, 149), "16: " + getCheckMessage(MSG_KEY, 100, 149), + }; +@@ -81,7 +81,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineLengthIgnoringPackageStatements() throws Exception { ++ void lineLengthIgnoringPackageStatements() throws Exception { + final String[] expected = { + "13: " + getCheckMessage(MSG_KEY, 75, 76), + "22: " + getCheckMessage(MSG_KEY, 75, 86), +@@ -94,7 +94,7 @@ public class LineLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineLengthIgnoringImportStatements() throws Exception { ++ void lineLengthIgnoringImportStatements() throws Exception { + final String[] expected = { + "12: " + getCheckMessage(MSG_KEY, 75, 79), + "21: " + getCheckMessage(MSG_KEY, 75, 81), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java +index 3b9d7cba7..5c757e0ac 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodCountCheckTest.java +@@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MethodCountCheckTest extends AbstractModuleTestSupport { ++final class MethodCountCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +39,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MethodCountCheck checkObj = new MethodCountCheck(); + final int[] expected = {TokenTypes.METHOD_DEF}; + assertWithMessage("Default required tokens are invalid") +@@ -48,7 +48,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MethodCountCheck methodCountCheckObj = new MethodCountCheck(); + final int[] actual = methodCountCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -65,7 +65,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaults() throws Exception { ++ void defaults() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -73,7 +73,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThrees() throws Exception { ++ void threes() throws Exception { + + final String[] expected = { + "15:1: " + getCheckMessage(MSG_PACKAGE_METHODS, 5, 3), +@@ -91,7 +91,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEnum() throws Exception { ++ void testEnum() throws Exception { + + final String[] expected = { + "21:5: " + getCheckMessage(MSG_PRIVATE_METHODS, 1, 0), +@@ -102,7 +102,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithPackageModifier() throws Exception { ++ void withPackageModifier() throws Exception { + + final String[] expected = { + "15:1: " + getCheckMessage(MSG_MANY_METHODS, 5, 2), +@@ -112,7 +112,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOnInterfaceDefinitionWithField() throws Exception { ++ void onInterfaceDefinitionWithField() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -120,7 +120,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithInterfaceDefinitionInClass() throws Exception { ++ void withInterfaceDefinitionInClass() throws Exception { + + final String[] expected = { + "15:1: " + getCheckMessage(MSG_MANY_METHODS, 2, 1), +@@ -130,7 +130,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPartialTokens() throws Exception { ++ void partialTokens() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -138,7 +138,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCountMethodToCorrectDefinition() throws Exception { ++ void countMethodToCorrectDefinition() throws Exception { + + final String[] expected = { + "22:5: " + getCheckMessage(MSG_MANY_METHODS, 2, 1), +@@ -148,7 +148,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceMemberScopeIsPublic() throws Exception { ++ void interfaceMemberScopeIsPublic() throws Exception { + + final String[] expected = { + "17:5: " + getCheckMessage(MSG_PUBLIC_METHODS, 2, 1), +@@ -160,7 +160,7 @@ public class MethodCountCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodCountRecords() throws Exception { ++ void methodCountRecords() throws Exception { + final int max = 2; + + final String[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java +index 90147b4f2..47a4cdd80 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/MethodLengthCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MethodLengthCheckTest extends AbstractModuleTestSupport { ++final class MethodLengthCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MethodLengthCheck checkObj = new MethodLengthCheck(); + assertWithMessage( + "MethodLengthCheck#getRequiredTokens should return empty array " + "by default") +@@ -44,7 +44,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MethodLengthCheck methodLengthCheckObj = new MethodLengthCheck(); + final int[] actual = methodLengthCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -55,7 +55,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIt() throws Exception { ++ void it() throws Exception { + final String[] expected = { + "76:5: " + getCheckMessage(MSG_KEY, 20, 19, "longMethod"), + }; +@@ -63,13 +63,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCountEmptyIsFalse() throws Exception { ++ void countEmptyIsFalse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodLengthCountEmptyIsFalse.java"), expected); + } + + @Test +- public void testWithComments() throws Exception { ++ void withComments() throws Exception { + final String[] expected = { + "34:5: " + getCheckMessage(MSG_KEY, 8, 7, "visit"), + }; +@@ -77,7 +77,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCountEmpty() throws Exception { ++ void countEmpty() throws Exception { + final int max = 2; + final String[] expected = { + "24:5: " + getCheckMessage(MSG_KEY, 3, max, "AA"), +@@ -90,13 +90,13 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAbstract() throws Exception { ++ void testAbstract() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodLengthModifier.java"), expected); + } + + @Test +- public void testTextBlocks() throws Exception { ++ void textBlocks() throws Exception { + final int max = 2; + + final String[] expected = { +@@ -111,7 +111,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsAndCompactCtors() throws Exception { ++ void recordsAndCompactCtors() throws Exception { + + final int max = 2; + +@@ -128,7 +128,7 @@ public class MethodLengthCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordsAndCompactCtorsCountEmpty() throws Exception { ++ void recordsAndCompactCtorsCountEmpty() throws Exception { + final int max = 2; + + final String[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java +index 588942c90..ff2f5003b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/OuterTypeNumberCheckTest.java +@@ -32,7 +32,7 @@ import java.io.File; + import java.util.Optional; + import org.junit.jupiter.api.Test; + +-public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { ++final class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -40,7 +40,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final OuterTypeNumberCheck checkObj = new OuterTypeNumberCheck(); + final int[] expected = { + TokenTypes.CLASS_DEF, +@@ -55,7 +55,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final OuterTypeNumberCheck outerTypeNumberObj = new OuterTypeNumberCheck(); + final int[] actual = outerTypeNumberObj.getAcceptableTokens(); + final int[] expected = { +@@ -70,7 +70,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_KEY, 3, 1), + }; +@@ -78,19 +78,19 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMax30() throws Exception { ++ void max30() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeNumberSimple1.java"), expected); + } + + @Test +- public void testWithInnerClass() throws Exception { ++ void withInnerClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOuterTypeNumberEmptyInner.java"), expected); + } + + @Test +- public void testWithRecords() throws Exception { ++ void withRecords() throws Exception { + + final int max = 1; + +@@ -109,7 +109,7 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { + * @throws Exception if there is an error. + */ + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final OuterTypeNumberCheck check = new OuterTypeNumberCheck(); + final DetailAST root = + JavaParser.parseFile( +@@ -123,14 +123,17 @@ public class OuterTypeNumberCheckTest extends AbstractModuleTestSupport { + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( + check, +- classDef.get(), ++ classDef.orElseThrow(), + "currentDepth", + currentDepth -> ((Number) currentDepth).intValue() == 0)) + .isTrue(); + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +- check, classDef.get(), "outerNum", outerNum -> ((Number) outerNum).intValue() == 0)) ++ check, ++ classDef.orElseThrow(), ++ "outerNum", ++ outerNum -> ((Number) outerNum).intValue() == 0)) + .isTrue(); + } + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java +index 5a67835d3..3064327e8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/ParameterNumberCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class ParameterNumberCheckTest extends AbstractModuleTestSupport { ++final class ParameterNumberCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final ParameterNumberCheck checkObj = new ParameterNumberCheck(); + assertWithMessage( + "ParameterNumberCheck#getRequiredTokens should return empty array " + "by default") +@@ -44,7 +44,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final ParameterNumberCheck paramNumberCheckObj = new ParameterNumberCheck(); + final int[] actual = paramNumberCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -55,7 +55,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "198:10: " + getCheckMessage(MSG_KEY, 7, 9), + }; +@@ -63,7 +63,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNum() throws Exception { ++ void num() throws Exception { + final String[] expected = { + "75:9: " + getCheckMessage(MSG_KEY, 2, 3), "198:10: " + getCheckMessage(MSG_KEY, 2, 9), + }; +@@ -71,13 +71,13 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMaxParam() throws Exception { ++ void maxParam() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParameterNumberSimple3.java"), expected); + } + + @Test +- public void shouldLogActualParameterNumber() throws Exception { ++ void shouldLogActualParameterNumber() throws Exception { + final String[] expected = { + "199:10: 7,9", + }; +@@ -85,7 +85,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreOverriddenMethods() throws Exception { ++ void ignoreOverriddenMethods() throws Exception { + final String[] expected = { + "15:10: " + getCheckMessage(MSG_KEY, 7, 8), "20:10: " + getCheckMessage(MSG_KEY, 7, 8), + }; +@@ -93,7 +93,7 @@ public class ParameterNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreOverriddenMethodsFalse() throws Exception { ++ void ignoreOverriddenMethodsFalse() throws Exception { + final String[] expected = { + "15:10: " + getCheckMessage(MSG_KEY, 7, 8), + "20:10: " + getCheckMessage(MSG_KEY, 7, 8), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckTest.java +index 191521a19..546d349b9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/sizes/RecordComponentNumberCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { ++final class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final RecordComponentNumberCheck checkObj = new RecordComponentNumberCheck(); + final int[] actual = checkObj.getRequiredTokens(); + final int[] expected = { +@@ -48,7 +48,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final RecordComponentNumberCheck checkObj = new RecordComponentNumberCheck(); + final int[] actual = checkObj.getAcceptableTokens(); + final int[] expected = { +@@ -59,7 +59,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final int max = 8; + +@@ -77,7 +77,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentNumberTopLevel1() throws Exception { ++ void recordComponentNumberTopLevel1() throws Exception { + + final int max = 8; + +@@ -90,7 +90,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentNumberTopLevel2() throws Exception { ++ void recordComponentNumberTopLevel2() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -99,7 +99,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentNumberMax1() throws Exception { ++ void recordComponentNumberMax1() throws Exception { + + final int max = 1; + +@@ -125,7 +125,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentNumberMax20() throws Exception { ++ void recordComponentNumberMax20() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser( +@@ -133,7 +133,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRecordComponentNumberPrivateModifier() throws Exception { ++ void recordComponentNumberPrivateModifier() throws Exception { + + final int max = 8; + +@@ -155,7 +155,7 @@ public class RecordComponentNumberCheckTest extends AbstractModuleTestSupport { + * @throws Exception if an error occurs. + */ + @Test +- public void testCloneInAccessModifiersProperty() throws Exception { ++ void cloneInAccessModifiersProperty() throws Exception { + final AccessModifierOption[] input = { + AccessModifierOption.PACKAGE, + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java +index ec9706c37..022fa5cdf 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForInitializerPadCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { ++final class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,7 +38,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final EmptyForInitializerPadCheck checkObj = new EmptyForInitializerPadCheck(); + final int[] expected = {TokenTypes.FOR_INIT}; + assertWithMessage("Default required tokens are invalid") +@@ -47,7 +47,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "51:15: " + getCheckMessage(MSG_PRECEDED, ";"), + }; +@@ -56,7 +56,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceOption() throws Exception { ++ void spaceOption() throws Exception { + final String[] expected = { + "54:14: " + getCheckMessage(MSG_NOT_PRECEDED, ";"), + }; +@@ -64,7 +64,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final EmptyForInitializerPadCheck emptyForInitializerPadCheckObj = + new EmptyForInitializerPadCheck(); + final int[] actual = emptyForInitializerPadCheckObj.getAcceptableTokens(); +@@ -79,7 +79,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testPadOptionValueOf() { ++ void padOptionValueOf() { + final PadOption option = PadOption.valueOf("NOSPACE"); + assertWithMessage("Result of valueOf is invalid").that(option).isEqualTo(PadOption.NOSPACE); + } +@@ -89,13 +89,13 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + * valueOf() is uncovered. + */ + @Test +- public void testWrapOptionValueOf() { ++ void wrapOptionValueOf() { + final WrapOption option = WrapOption.valueOf("EOL"); + assertWithMessage("Result of valueOf is invalid").that(option).isEqualTo(WrapOption.EOL); + } + + @Test +- public void testWithEmoji() throws Exception { ++ void withEmoji() throws Exception { + final String[] expected = { + "23:13: " + getCheckMessage(MSG_NOT_PRECEDED, ";"), + "28:25: " + getCheckMessage(MSG_NOT_PRECEDED, ";"), +@@ -104,7 +104,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(EmptyForInitializerPadCheck.class); + checkConfig.addProperty("option", "invalid_option"); + +@@ -125,7 +125,7 @@ public class EmptyForInitializerPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "15:14: " + getCheckMessage(MSG_NOT_PRECEDED, ";"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java +index ac886e1c4..80604d001 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyForIteratorPadCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { ++final class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final EmptyForIteratorPadCheck checkObj = new EmptyForIteratorPadCheck(); + final int[] expected = {TokenTypes.FOR_ITERATOR}; + assertWithMessage("Default required tokens are invalid") +@@ -46,7 +46,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "30:32: " + getCheckMessage(MSG_WS_FOLLOWED, ";"), + "46:33: " + getCheckMessage(MSG_WS_FOLLOWED, ";"), +@@ -56,7 +56,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceOption() throws Exception { ++ void spaceOption() throws Exception { + final String[] expected = { + "26:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + }; +@@ -64,7 +64,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithEmoji() throws Exception { ++ void withEmoji() throws Exception { + final String[] expected = { + "24:40: " + getCheckMessage(MSG_WS_FOLLOWED, ";"), + }; +@@ -72,7 +72,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final EmptyForIteratorPadCheck emptyForIteratorPadCheckObj = new EmptyForIteratorPadCheck(); + final int[] actual = emptyForIteratorPadCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -82,7 +82,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -100,7 +100,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "20:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + }; +@@ -109,7 +109,7 @@ public class EmptyForIteratorPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUppercaseOptionProperty() throws Exception { ++ void uppercaseOptionProperty() throws Exception { + final String[] expected = { + "20:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java +index 1ae7fb850..080017b8a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/EmptyLineSeparatorCheckTest.java +@@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { ++final class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +39,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final EmptyLineSeparatorCheck checkObj = new EmptyLineSeparatorCheck(); + assertWithMessage( + "EmptyLineSeparatorCheck#getRequiredTokens should return empty array " + "by default") +@@ -48,7 +48,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), +@@ -65,7 +65,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowNoEmptyLineBetweenFields() throws Exception { ++ void allowNoEmptyLineBetweenFields() throws Exception { + + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), +@@ -81,7 +81,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testHeader() throws Exception { ++ void header() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), + }; +@@ -89,7 +89,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleEmptyLinesBetweenClassMembers() throws Exception { ++ void multipleEmptyLinesBetweenClassMembers() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_MULTIPLE_LINES, "package"), + "17:1: " + getCheckMessage(MSG_MULTIPLE_LINES, "import"), +@@ -104,20 +104,20 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFormerArrayIndexOutOfBounds() throws Exception { ++ void formerArrayIndexOutOfBounds() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputEmptyLineSeparatorFormerException.java"), expected); + } + + @Test +- public void testAllowMultipleFieldInClass() throws Exception { ++ void allowMultipleFieldInClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputEmptyLineSeparatorMultipleFieldsInClass.java"), expected); + } + + @Test +- public void testAllowMultipleImportSeparatedFromPackage() throws Exception { ++ void allowMultipleImportSeparatedFromPackage() throws Exception { + final String[] expected = { + "13:78: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), + }; +@@ -126,14 +126,14 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportSeparatedFromPackage() throws Exception { ++ void importSeparatedFromPackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputEmptyLineSeparatorImportSeparatedFromPackage.java"), expected); + } + + @Test +- public void testStaticImport() throws Exception { ++ void staticImport() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), + }; +@@ -141,7 +141,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlockCommentNotSeparatedFromPackage() throws Exception { ++ void blockCommentNotSeparatedFromPackage() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "/*"), + }; +@@ -150,7 +150,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSingleCommentNotSeparatedFromPackage() throws Exception { ++ void singleCommentNotSeparatedFromPackage() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "//"), + }; +@@ -159,7 +159,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassDefinitionNotSeparatedFromPackage() throws Exception { ++ void classDefinitionNotSeparatedFromPackage() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), + }; +@@ -168,7 +168,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommentAfterPackageWithImports() throws Exception { ++ void commentAfterPackageWithImports() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "//"), + }; +@@ -177,7 +177,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavadocCommentAfterPackageWithImports() throws Exception { ++ void javadocCommentAfterPackageWithImports() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(EmptyLineSeparatorCheck.class); + final String[] expected = { + "2:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "/*"), +@@ -187,7 +187,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackageImportsClassInSingleLine() throws Exception { ++ void packageImportsClassInSingleLine() throws Exception { + final String[] expected = { + "13:79: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "import"), + "13:101: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), +@@ -197,7 +197,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineAfterPackageForPackageAst() throws Exception { ++ void emptyLineAfterPackageForPackageAst() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "/*"), + }; +@@ -206,14 +206,14 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineAfterPackageForImportAst() throws Exception { ++ void emptyLineAfterPackageForImportAst() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputEmptyLineSeparatorEmptyLineAfterPackageForImportAst.java"), expected); + } + + @Test +- public void testClassDefinitionAndCommentNotSeparatedFromPackage() throws Exception { ++ void classDefinitionAndCommentNotSeparatedFromPackage() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "//"), + "15:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), +@@ -224,21 +224,21 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBlockCommentSeparatedFromPackage() throws Exception { ++ void blockCommentSeparatedFromPackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputEmptyLineSeparatorBlockCommentSeparatedFromPackage.java"), expected); + } + + @Test +- public void testSingleCommentSeparatedFromPackage() throws Exception { ++ void singleCommentSeparatedFromPackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputEmptyLineSeparatorSingleCommentSeparatedFromPackage.java"), expected); + } + + @Test +- public void testEnumMembers() throws Exception { ++ void enumMembers() throws Exception { + final String[] expected = { + "22:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), + "27:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), +@@ -251,7 +251,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInterfaceFields() throws Exception { ++ void interfaceFields() throws Exception { + final String[] expected = { + "21:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), + "25:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), +@@ -263,7 +263,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final EmptyLineSeparatorCheck emptyLineSeparatorCheckObj = new EmptyLineSeparatorCheck(); + final int[] actual = emptyLineSeparatorCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -285,7 +285,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPrePreviousLineEmptiness() throws Exception { ++ void prePreviousLineEmptiness() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(EmptyLineSeparatorCheck.class); + checkConfig.addProperty("allowMultipleEmptyLines", "false"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -293,7 +293,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPrePreviousLineIsEmpty() throws Exception { ++ void prePreviousLineIsEmpty() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(EmptyLineSeparatorCheck.class); + checkConfig.addProperty("allowMultipleEmptyLines", "false"); + final String[] expected = { +@@ -303,7 +303,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPreviousLineEmptiness() throws Exception { ++ void previousLineEmptiness() throws Exception { + final String[] expected = { + "21:30: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), + "26:5: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), +@@ -316,7 +316,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDisAllowMultipleEmptyLinesInsideClassMembers() throws Exception { ++ void disAllowMultipleEmptyLinesInsideClassMembers() throws Exception { + final String[] expected = { + "18:11: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), + "30:11: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), +@@ -330,7 +330,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowMultipleEmptyLinesInsideClassMembers() throws Exception { ++ void allowMultipleEmptyLinesInsideClassMembers() throws Exception { + final String[] expected = { + "53:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), + }; +@@ -339,25 +339,25 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImportsAndStaticImports() throws Exception { ++ void importsAndStaticImports() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputEmptyLineSeparatorImports.java"), expected); + } + + @Test +- public void testAllowPackageAnnotation() throws Exception { ++ void allowPackageAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("packageinfo/test1/package-info.java"), expected); + } + + @Test +- public void testAllowJavadocBeforePackage() throws Exception { ++ void allowJavadocBeforePackage() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("packageinfo/test2/package-info.java"), expected); + } + + @Test +- public void testDisAllowBlockCommentBeforePackage() throws Exception { ++ void disAllowBlockCommentBeforePackage() throws Exception { + final String[] expected = { + "15:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), + }; +@@ -365,7 +365,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowSingleLineCommentPackage() throws Exception { ++ void allowSingleLineCommentPackage() throws Exception { + final String[] expected = { + "16:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), + }; +@@ -373,7 +373,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonPackageInfoWithJavadocBeforePackage() throws Exception { ++ void nonPackageInfoWithJavadocBeforePackage() throws Exception { + final String[] expected = { + "15:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), + }; +@@ -382,7 +382,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassOnly() throws Exception { ++ void classOnly() throws Exception { + final String[] expected = { + "51:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), + }; +@@ -391,7 +391,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLineSeparationBeforeComments() throws Exception { ++ void lineSeparationBeforeComments() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), + "16:1: " + getCheckMessage(MSG_MULTIPLE_LINES, "//"), +@@ -436,7 +436,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreEmptyLinesBeforeCommentsWhenItIsAllowed() throws Exception { ++ void ignoreEmptyLinesBeforeCommentsWhenItIsAllowed() throws Exception { + final String[] expected = { + "12:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), + "239:5: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "INTERFACE_DEF"), +@@ -445,14 +445,14 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoViolationsOnEmptyLinesBeforeComments() throws Exception { ++ void noViolationsOnEmptyLinesBeforeComments() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputEmptyLineSeparatorNoViolationOnEmptyLineBeforeComments.java"), expected); + } + + @Test +- public void testEmptyLineSeparatorRecordsAndCompactCtors() throws Exception { ++ void emptyLineSeparatorRecordsAndCompactCtors() throws Exception { + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), + "18:5: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "RECORD_DEF"), +@@ -476,7 +476,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparatorRecordsAndCompactCtorsNoEmptyLines() throws Exception { ++ void emptyLineSeparatorRecordsAndCompactCtorsNoEmptyLines() throws Exception { + + final String[] expected = { + "14:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "package"), +@@ -490,7 +490,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparatorMultipleSingleTypeVariables() throws Exception { ++ void emptyLineSeparatorMultipleSingleTypeVariables() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -499,7 +499,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparatorEmptyLinesInsideClassMembersRecursive() throws Exception { ++ void emptyLineSeparatorEmptyLinesInsideClassMembersRecursive() throws Exception { + final String[] expected = { + "27:15: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), + }; +@@ -507,7 +507,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparatorNewMethodDef() throws Exception { ++ void emptyLineSeparatorNewMethodDef() throws Exception { + final String[] expected = { + "29:34: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), + "38:26: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), +@@ -516,7 +516,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparatorPostFixCornerCases() throws Exception { ++ void emptyLineSeparatorPostFixCornerCases() throws Exception { + final String[] expected = { + "18:19: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), + "32:29: " + getCheckMessage(MSG_MULTIPLE_LINES_INSIDE), +@@ -527,7 +527,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparatorAnnotation() throws Exception { ++ void emptyLineSeparatorAnnotation() throws Exception { + final String[] expected = { + "18:22: " + getCheckMessage(MSG_MULTIPLE_LINES_AFTER, "}"), + }; +@@ -535,7 +535,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLineSeparatorWithEmoji() throws Exception { ++ void emptyLineSeparatorWithEmoji() throws Exception { + + final String[] expected = { + "22:5: " + getCheckMessage(MSG_MULTIPLE_LINES, "VARIABLE_DEF"), +@@ -547,13 +547,13 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleLines() throws Exception { ++ void multipleLines() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputEmptyLineSeparatorMultipleLines.java"), expected); + } + + @Test +- public void testMultipleLines2() throws Exception { ++ void multipleLines2() throws Exception { + final String[] expected = { + "15:1: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "CLASS_DEF"), + }; +@@ -561,7 +561,7 @@ public class EmptyLineSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultipleLines3() throws Exception { ++ void multipleLines3() throws Exception { + final String[] expected = { + "24:5: " + getCheckMessage(MSG_SHOULD_BE_SEPARATED, "VARIABLE_DEF"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java +index a2125adf1..c1ee86cb4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/FileTabCharacterCheckTest.java +@@ -25,7 +25,7 @@ import static com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacter + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import org.junit.jupiter.api.Test; + +-public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { ++final class FileTabCharacterCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "22:25: " + getCheckMessage(MSG_FILE_CONTAINS_TAB), + }; +@@ -41,7 +41,7 @@ public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomMessage() throws Exception { ++ void customMessage() throws Exception { + final String msgFileContainsTab = + "File contains tab characters (this is the first instance) :)"; + final String[] expected = { +@@ -51,7 +51,7 @@ public class FileTabCharacterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVerbose() throws Exception { ++ void verbose() throws Exception { + final String[] expected = { + "22:25: " + getCheckMessage(MSG_CONTAINS_TAB), + "148:35: " + getCheckMessage(MSG_CONTAINS_TAB), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java +index 8be0e96d0..57828bdc4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/GenericWhitespaceCheckTest.java +@@ -40,7 +40,7 @@ import java.util.Optional; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { ++final class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -48,7 +48,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final GenericWhitespaceCheck checkObj = new GenericWhitespaceCheck(); + final int[] expected = { + TokenTypes.GENERIC_START, TokenTypes.GENERIC_END, +@@ -59,7 +59,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "22:14: " + getCheckMessage(MSG_WS_PRECEDED, "<"), + "22:14: " + getCheckMessage(MSG_WS_FOLLOWED, "<"), +@@ -100,7 +100,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAtTheStartOfTheLine() throws Exception { ++ void atTheStartOfTheLine() throws Exception { + final String[] expected = { + "16:2: " + getCheckMessage(MSG_WS_PRECEDED, ">"), + "18:2: " + getCheckMessage(MSG_WS_PRECEDED, "<"), +@@ -109,7 +109,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNestedGeneric() throws Exception { ++ void nestedGeneric() throws Exception { + final String[] expected = { + "17:1: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "&"), + }; +@@ -117,25 +117,25 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testList() throws Exception { ++ void list() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputGenericWhitespaceList.java"), expected); + } + + @Test +- public void testInnerClass() throws Exception { ++ void innerClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputGenericWhitespaceInnerClass.java"), expected); + } + + @Test +- public void testMethodReferences() throws Exception { ++ void methodReferences() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputGenericWhitespaceMethodRef1.java"), expected); + } + + @Test +- public void testMethodReferences2() throws Exception { ++ void methodReferences2() throws Exception { + final String[] expected = { + "16:37: " + getCheckMessage(MSG_WS_FOLLOWED, ">"), + }; +@@ -143,13 +143,13 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGenericEndsTheLine() throws Exception { ++ void genericEndsTheLine() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputGenericWhitespaceEndsTheLine.java"), expected); + } + + @Test +- public void testGenericWhitespaceWithEmoji() throws Exception { ++ void genericWhitespaceWithEmoji() throws Exception { + final String[] expected = { + "35:2: " + getCheckMessage(MSG_WS_PRECEDED, '>'), + "40:35: " + getCheckMessage(MSG_WS_PRECEDED, '<'), +@@ -167,7 +167,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + * @throws Exception if there is an error. + */ + @Test +- public void testClearState() throws Exception { ++ void clearState() throws Exception { + final GenericWhitespaceCheck check = new GenericWhitespaceCheck(); + final FileText fileText = + new FileText( +@@ -181,12 +181,15 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + assertWithMessage("State is not cleared on beginTree") + .that( + TestUtil.isStatefulFieldClearedDuringBeginTree( +- check, genericStart.get(), "depth", depth -> ((Number) depth).intValue() == 0)) ++ check, ++ genericStart.orElseThrow(), ++ "depth", ++ depth -> ((Number) depth).intValue() == 0)) + .isTrue(); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final GenericWhitespaceCheck genericWhitespaceCheckObj = new GenericWhitespaceCheck(); + final int[] actual = genericWhitespaceCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -196,7 +199,7 @@ public class GenericWhitespaceCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWrongTokenType() { ++ void wrongTokenType() { + final GenericWhitespaceCheck genericWhitespaceCheckObj = new GenericWhitespaceCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + ast.initialize(new CommonToken(TokenTypes.INTERFACE_DEF, "interface")); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java +index 9c7470e7f..538a0c66e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/MethodParamPadCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MethodParamPadCheckTest extends AbstractModuleTestSupport { ++final class MethodParamPadCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,7 +38,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final MethodParamPadCheck checkObj = new MethodParamPadCheck(); + assertWithMessage( + "MethodParamPadCheck#getRequiredTokens should return empty array " + "by default") +@@ -47,7 +47,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "21:32: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "23:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), +@@ -72,7 +72,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowLineBreaks() throws Exception { ++ void allowLineBreaks() throws Exception { + final String[] expected = { + "21:33: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "23:15: " + getCheckMessage(MSG_WS_PRECEDED, "("), +@@ -88,7 +88,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceOption() throws Exception { ++ void spaceOption() throws Exception { + final String[] expected = { + "16:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "18:14: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), +@@ -117,7 +117,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodParamPadRecords() throws Exception { ++ void methodParamPadRecords() throws Exception { + final String[] expected = { + "19:25: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "20:34: " + getCheckMessage(MSG_WS_PRECEDED, "("), +@@ -134,13 +134,13 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test1322879() throws Exception { ++ void test1322879() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodParamPadWhitespaceAround.java"), expected); + } + + @Test +- public void testMethodParamPadCheckWithEmoji() throws Exception { ++ void methodParamPadCheckWithEmoji() throws Exception { + final String[] expected = { + "19:31: " + getCheckMessage(MSG_WS_PRECEDED, "("), + "21:30: " + getCheckMessage(MSG_WS_PRECEDED, "("), +@@ -156,7 +156,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final MethodParamPadCheck methodParamPadCheckObj = new MethodParamPadCheck(); + final int[] actual = methodParamPadCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -172,7 +172,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -190,7 +190,7 @@ public class MethodParamPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "15:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), + "26:27: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "("), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java +index e3b15821a..16d74fca3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoLineWrapCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NoLineWrapCheckTest extends AbstractModuleTestSupport { ++final class NoLineWrapCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,13 +33,13 @@ public class NoLineWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCaseWithoutLineWrapping() throws Exception { ++ void caseWithoutLineWrapping() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNoLineWrapGood.java"), expected); + } + + @Test +- public void testDefaultTokensLineWrapping() throws Exception { ++ void defaultTokensLineWrapping() throws Exception { + final String[] expected = { + "8:1: " + getCheckMessage(MSG_KEY, "package"), + "13:1: " + getCheckMessage(MSG_KEY, "import"), +@@ -49,7 +49,7 @@ public class NoLineWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCustomTokensLineWrapping() throws Exception { ++ void customTokensLineWrapping() throws Exception { + final String[] expected = { + "13:1: " + getCheckMessage(MSG_KEY, "import"), + "17:1: " + getCheckMessage(MSG_KEY, "import"), +@@ -61,7 +61,7 @@ public class NoLineWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoLineWrapRecordsAndCompactCtors() throws Exception { ++ void noLineWrapRecordsAndCompactCtors() throws Exception { + + final String[] expected = { + "13:9: " + getCheckMessage(MSG_KEY, "CTOR_DEF"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java +index 520c65113..e0433ff21 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceAfterCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.antlr.v4.runtime.CommonToken; + import org.junit.jupiter.api.Test; + +-public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { ++final class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "10:13: " + getCheckMessage(MSG_KEY, "."), + "11:11: " + getCheckMessage(MSG_KEY, "."), +@@ -61,13 +61,13 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAssignment() throws Exception { ++ void assignment() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputNoWhitespaceAfterTestAssignment.java"), expected); + } + + @Test +- public void testDotAllowLineBreaks() throws Exception { ++ void dotAllowLineBreaks() throws Exception { + final String[] expected = { + "9:13: " + getCheckMessage(MSG_KEY, "."), + "129:23: " + getCheckMessage(MSG_KEY, "."), +@@ -78,7 +78,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTypecast() throws Exception { ++ void typecast() throws Exception { + final String[] expected = { + "87:20: " + getCheckMessage(MSG_KEY, ")"), + "89:13: " + getCheckMessage(MSG_KEY, ")"), +@@ -88,7 +88,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayDeclarations() throws Exception { ++ void arrayDeclarations() throws Exception { + final String[] expected = { + "14:12: " + getCheckMessage(MSG_KEY, "Object"), + "16:23: " + getCheckMessage(MSG_KEY, "someStuff3"), +@@ -116,7 +116,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayDeclarations2() throws Exception { ++ void arrayDeclarations2() throws Exception { + final String[] expected = { + "20:31: " + getCheckMessage(MSG_KEY, "]"), + "25:41: " + getCheckMessage(MSG_KEY, "create"), +@@ -166,12 +166,12 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayDeclarations3() throws Exception { ++ void arrayDeclarations3() throws Exception { + verifyWithInlineConfigParser(getPath("InputNoWhitespaceAfterArrayDeclarations3.java")); + } + + @Test +- public void testSynchronized() throws Exception { ++ void testSynchronized() throws Exception { + final String[] expected = { + "22:9: " + getCheckMessage(MSG_KEY, "synchronized"), + }; +@@ -179,12 +179,12 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNpe() throws Exception { ++ void npe() throws Exception { + verifyWithInlineConfigParser(getPath("InputNoWhitespaceAfterTestNpe.java")); + } + + @Test +- public void testMethodReference() throws Exception { ++ void methodReference() throws Exception { + final String[] expected = { + "17:41: " + getCheckMessage(MSG_KEY, "int"), "18:62: " + getCheckMessage(MSG_KEY, "String"), + }; +@@ -192,7 +192,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodReferenceAfter() throws Exception { ++ void methodReferenceAfter() throws Exception { + final String[] expected = { + "25:35: " + getCheckMessage(MSG_KEY, "::"), "26:64: " + getCheckMessage(MSG_KEY, "::"), + }; +@@ -201,7 +201,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayDeclarator() throws Exception { ++ void arrayDeclarator() throws Exception { + final String[] expected = { + "19:32: " + getCheckMessage(MSG_KEY, "Entry"), + }; +@@ -210,7 +210,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVisitTokenSwitchReflection() { ++ void visitTokenSwitchReflection() { + // unexpected parent for ARRAY_DECLARATOR token + final DetailAstImpl astImport = mockAST(TokenTypes.IMPORT, "import"); + final DetailAstImpl astArrayDeclarator = mockAST(TokenTypes.ARRAY_DECLARATOR, "["); +@@ -230,7 +230,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllTokens() throws Exception { ++ void allTokens() throws Exception { + final String[] expected = { + "10:13: " + getCheckMessage(MSG_KEY, "."), + "11:11: " + getCheckMessage(MSG_KEY, "."), +@@ -259,14 +259,14 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayDeclarationsAndAnnotations() throws Exception { ++ void arrayDeclarationsAndAnnotations() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputNoWhitespaceAfterArrayDeclarationsAndAnno.java"), expected); + } + + @Test +- public void testArrayNewTypeStructure() throws Exception { ++ void arrayNewTypeStructure() throws Exception { + final String[] expected = { + "53:17: " + getCheckMessage(MSG_KEY, "ci"), + "54:27: " + getCheckMessage(MSG_KEY, "int"), +@@ -297,7 +297,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayNewGenericTypeArgument() throws Exception { ++ void arrayNewGenericTypeArgument() throws Exception { + + final String[] expected = { + "59:15: " + getCheckMessage(MSG_KEY, "i"), +@@ -323,7 +323,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoWhitespaceAfterWithEmoji() throws Exception { ++ void noWhitespaceAfterWithEmoji() throws Exception { + + final String[] expected = { + "16:16: " + getCheckMessage(MSG_KEY, "String"), +@@ -339,7 +339,7 @@ public class NoWhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoWhitespaceAfterSynchronized() throws Exception { ++ void noWhitespaceAfterSynchronized() throws Exception { + final String[] expected = { + "18:9: " + getCheckMessage(MSG_KEY, "synchronized"), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCaseDefaultColonCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCaseDefaultColonCheckTest.java +index 0cc8c952f..c74a5f086 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCaseDefaultColonCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCaseDefaultColonCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleTestSupport { ++final class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleT + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + createModuleConfig(NoWhitespaceBeforeCaseDefaultColonCheck.class); + final String[] expected = { + "15:20: " + getCheckMessage(MSG_KEY, ":"), +@@ -56,7 +56,7 @@ public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleT + } + + @Test +- public void testDefaultNonCompilable() throws Exception { ++ void defaultNonCompilable() throws Exception { + createModuleConfig(NoWhitespaceBeforeCaseDefaultColonCheck.class); + final String[] expected = { + "36:22: " + getCheckMessage(MSG_KEY, ":"), +@@ -74,7 +74,7 @@ public class NoWhitespaceBeforeCaseDefaultColonCheckTest extends AbstractModuleT + } + + @Test +- public void testAcceptableTokenIsColon() { ++ void acceptableTokenIsColon() { + final NoWhitespaceBeforeCaseDefaultColonCheck check = + new NoWhitespaceBeforeCaseDefaultColonCheck(); + assertWithMessage("Acceptable token should be colon") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java +index 35a25bead..e5e9b002f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/NoWhitespaceBeforeCheckTest.java +@@ -25,7 +25,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { ++final class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -33,7 +33,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "34:15: " + getCheckMessage(MSG_KEY, "++"), + "34:22: " + getCheckMessage(MSG_KEY, "--"), +@@ -53,7 +53,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDot() throws Exception { ++ void dot() throws Exception { + final String[] expected = { + "9:13: " + getCheckMessage(MSG_KEY, "."), + "10:5: " + getCheckMessage(MSG_KEY, "."), +@@ -66,7 +66,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDotAllowLineBreaks() throws Exception { ++ void dotAllowLineBreaks() throws Exception { + final String[] expected = { + "9:13: " + getCheckMessage(MSG_KEY, "."), + "133:18: " + getCheckMessage(MSG_KEY, "."), +@@ -77,7 +77,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodReference() throws Exception { ++ void methodReference() throws Exception { + final String[] expected = { + "25:32: " + getCheckMessage(MSG_KEY, "::"), "26:61: " + getCheckMessage(MSG_KEY, "::"), + }; +@@ -85,7 +85,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDotAtTheStartOfTheLine() throws Exception { ++ void dotAtTheStartOfTheLine() throws Exception { + final String[] expected = { + "10:1: " + getCheckMessage(MSG_KEY, "."), + }; +@@ -93,7 +93,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodRefAtTheStartOfTheLine() throws Exception { ++ void methodRefAtTheStartOfTheLine() throws Exception { + final String[] expected = { + "22:3: " + getCheckMessage(MSG_KEY, "::"), + }; +@@ -102,7 +102,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyForLoop() throws Exception { ++ void emptyForLoop() throws Exception { + final String[] expected = { + "20:24: " + getCheckMessage(MSG_KEY, ";"), "26:32: " + getCheckMessage(MSG_KEY, ";"), + }; +@@ -110,7 +110,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoWhitespaceBeforeTextBlocksWithTabIndent() throws Exception { ++ void noWhitespaceBeforeTextBlocksWithTabIndent() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -119,7 +119,7 @@ public class NoWhitespaceBeforeCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoWhitespaceBeforeWithEmoji() throws Exception { ++ void noWhitespaceBeforeWithEmoji() throws Exception { + final String[] expected = { + "13:15: " + getCheckMessage(MSG_KEY, ","), + "14:17: " + getCheckMessage(MSG_KEY, ","), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java +index fc83b6928..8e353db53 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/OperatorWrapCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class OperatorWrapCheckTest extends AbstractModuleTestSupport { ++final class OperatorWrapCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "23:19: " + getCheckMessage(MSG_LINE_NEW, "+"), + "24:15: " + getCheckMessage(MSG_LINE_NEW, "-"), +@@ -48,7 +48,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpWrapEol() throws Exception { ++ void opWrapEol() throws Exception { + final String[] expected = { + "26:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "-"), + "30:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "&&"), +@@ -58,7 +58,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonDefOpsDefault() throws Exception { ++ void nonDefOpsDefault() throws Exception { + final String[] expected = { + "37:33: " + getCheckMessage(MSG_LINE_NEW, "::"), + }; +@@ -66,7 +66,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonDefOpsWrapEol() throws Exception { ++ void nonDefOpsWrapEol() throws Exception { + final String[] expected = { + "35:21: " + getCheckMessage(MSG_LINE_PREVIOUS, "::"), + "40:21: " + getCheckMessage(MSG_LINE_PREVIOUS, "::"), +@@ -75,7 +75,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAssignEol() throws Exception { ++ void assignEol() throws Exception { + final String[] expected = { + "46:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "="), + }; +@@ -83,7 +83,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEol() throws Exception { ++ void eol() throws Exception { + final String[] expected = { + "21:17: " + getCheckMessage(MSG_LINE_PREVIOUS, "="), + "22:17: " + getCheckMessage(MSG_LINE_PREVIOUS, "*"), +@@ -99,7 +99,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNl() throws Exception { ++ void nl() throws Exception { + final String[] expected = { + "20:16: " + getCheckMessage(MSG_LINE_NEW, "="), + "21:19: " + getCheckMessage(MSG_LINE_NEW, "*"), +@@ -114,7 +114,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArraysAssign() throws Exception { ++ void arraysAssign() throws Exception { + final String[] expected = { + "18:22: " + getCheckMessage(MSG_LINE_NEW, "="), + "36:28: " + getCheckMessage(MSG_LINE_NEW, "="), +@@ -124,7 +124,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGuardedPattern() throws Exception { ++ void guardedPattern() throws Exception { + final String[] expected = { + "52:30: " + getCheckMessage(MSG_LINE_NEW, "&&"), + "54:31: " + getCheckMessage(MSG_LINE_NEW, "&&"), +@@ -142,13 +142,13 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResources() throws Exception { ++ void tryWithResources() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputOperatorWrapTryWithResources.java"), expected); + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -167,7 +167,7 @@ public class OperatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "18:21: " + getCheckMessage(MSG_LINE_PREVIOUS, ":"), + "19:21: " + getCheckMessage(MSG_LINE_PREVIOUS, "?"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java +index 840d65359..da79cc5d9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/ParenPadCheckTest.java +@@ -33,7 +33,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import com.puppycrawl.tools.checkstyle.utils.TokenUtil; + import org.junit.jupiter.api.Test; + +-public class ParenPadCheckTest extends AbstractModuleTestSupport { ++final class ParenPadCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,7 +41,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "65:11: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "65:37: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -57,7 +57,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpace() throws Exception { ++ void space() throws Exception { + final String[] expected = { + "36:19: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "36:23: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), +@@ -99,7 +99,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultForIterator() throws Exception { ++ void defaultForIterator() throws Exception { + final String[] expected = { + "24:35: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "27:36: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -113,7 +113,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceEmptyForIterator() throws Exception { ++ void spaceEmptyForIterator() throws Exception { + final String[] expected = { + "18:13: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "18:35: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), +@@ -129,20 +129,20 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test1322879() throws Exception { ++ void test1322879() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParenPadWithSpace.java"), expected); + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getPath("InputParenPadToCheckTrimFunctionInOptionProperty.java"), expected); + } + + @Test +- public void testNospaceWithComplexInput() throws Exception { ++ void nospaceWithComplexInput() throws Exception { + final String[] expected = { + "55:26: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "55:28: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -270,7 +270,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testConfigureTokens() throws Exception { ++ void configureTokens() throws Exception { + final String[] expected = { + "98:39: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "121:22: " + getCheckMessage(MSG_WS_FOLLOWED, "("), +@@ -303,7 +303,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -322,7 +322,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaAssignment() throws Exception { ++ void lambdaAssignment() throws Exception { + final String[] expected = { + "20:41: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "20:45: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -341,7 +341,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaAssignmentWithSpace() throws Exception { ++ void lambdaAssignmentWithSpace() throws Exception { + final String[] expected = { + "20:41: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "20:43: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), +@@ -358,7 +358,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaCheckDisabled() throws Exception { ++ void lambdaCheckDisabled() throws Exception { + final String[] expected = { + "27:61: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "27:63: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -369,7 +369,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaCheckDisabledWithSpace() throws Exception { ++ void lambdaCheckDisabledWithSpace() throws Exception { + final String[] expected = { + "30:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "30:33: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), +@@ -378,7 +378,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaCheckOnly() throws Exception { ++ void lambdaCheckOnly() throws Exception { + final String[] expected = { + "17:41: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "17:45: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -393,7 +393,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaCheckOnlyWithSpace() throws Exception { ++ void lambdaCheckOnlyWithSpace() throws Exception { + final String[] expected = { + "17:41: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "17:43: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), +@@ -408,7 +408,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaCheckOnlyWithSpace1() throws Exception { ++ void lambdaCheckOnlyWithSpace1() throws Exception { + final String[] expected = { + "16:2: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), + }; +@@ -416,7 +416,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResources() throws Exception { ++ void tryWithResources() throws Exception { + final String[] expected = { + "20:37: " + getCheckMessage(MSG_WS_PRECEDED, ")"), + "21:61: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -426,7 +426,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTryWithResourcesAndSuppression() throws Exception { ++ void tryWithResourcesAndSuppression() throws Exception { + final String[] expectedFiltered = CommonUtil.EMPTY_STRING_ARRAY; + final String[] expectedUnfiltered = { + "23:13: " + getCheckMessage(MSG_WS_FOLLOWED, "("), +@@ -438,13 +438,13 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoStackoverflowError() throws Exception { ++ void noStackoverflowError() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithLimitedResources(getPath("InputParenPadNoStackoverflowError.java"), expected); + } + + @Test +- public void testParenPadCheckRecords() throws Exception { ++ void parenPadCheckRecords() throws Exception { + + final String[] expected = { + "20:21: " + getCheckMessage(MSG_WS_FOLLOWED, "("), +@@ -465,7 +465,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParenPadCheckRecordsWithSpace() throws Exception { ++ void parenPadCheckRecordsWithSpace() throws Exception { + + final String[] expected = { + "25:19: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), +@@ -486,7 +486,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParenPadCheckEmoji() throws Exception { ++ void parenPadCheckEmoji() throws Exception { + + final String[] expected = { + "25:45: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -500,7 +500,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParenPadForSynchronized() throws Exception { ++ void parenPadForSynchronized() throws Exception { + + final String[] expected = { + "18:29: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -509,7 +509,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParenPadForEnum() throws Exception { ++ void parenPadForEnum() throws Exception { + + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputParenPadForEnum.java"), expected); +@@ -524,7 +524,7 @@ public class ParenPadCheckTest extends AbstractModuleTestSupport { + * pass that check. + */ + @Test +- public void testIsAcceptableToken() throws Exception { ++ void isAcceptableToken() throws Exception { + final ParenPadCheck check = new ParenPadCheck(); + final DetailAstImpl ast = new DetailAstImpl(); + final String message = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java +index 110d567a8..25def9cb5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SeparatorWrapCheckTest.java +@@ -29,7 +29,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { ++final class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,7 +37,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDot() throws Exception { ++ void dot() throws Exception { + final String[] expected = { + "39:10: " + getCheckMessage(MSG_LINE_NEW, "."), + }; +@@ -45,7 +45,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testComma() throws Exception { ++ void comma() throws Exception { + final String[] expected = { + "47:17: " + getCheckMessage(MSG_LINE_PREVIOUS, ","), + }; +@@ -53,7 +53,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodRef() throws Exception { ++ void methodRef() throws Exception { + final String[] expected = { + "25:56: " + getCheckMessage(MSG_LINE_NEW, "::"), + }; +@@ -61,7 +61,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetDefaultTokens() { ++ void getDefaultTokens() { + final SeparatorWrapCheck separatorWrapCheckObj = new SeparatorWrapCheck(); + final int[] actual = separatorWrapCheckObj.getDefaultTokens(); + final int[] expected = { +@@ -71,7 +71,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidOption() throws Exception { ++ void invalidOption() throws Exception { + + try { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; +@@ -90,7 +90,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEllipsis() throws Exception { ++ void ellipsis() throws Exception { + final String[] expected = { + "19:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "..."), + }; +@@ -98,7 +98,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayDeclarator() throws Exception { ++ void arrayDeclarator() throws Exception { + final String[] expected = { + "17:13: " + getCheckMessage(MSG_LINE_PREVIOUS, "["), + }; +@@ -106,7 +106,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWithEmoji() throws Exception { ++ void withEmoji() throws Exception { + final String[] expected = { + "13:39: " + getCheckMessage(MSG_LINE_NEW, '['), + "16:57: " + getCheckMessage(MSG_LINE_NEW, '['), +@@ -119,7 +119,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTrimOptionProperty() throws Exception { ++ void trimOptionProperty() throws Exception { + final String[] expected = { + "18:44: " + getCheckMessage(MSG_LINE_NEW, "::"), + }; +@@ -127,7 +127,7 @@ public class SeparatorWrapCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCommaOnNewLine() throws Exception { ++ void commaOnNewLine() throws Exception { + final String[] expected = { + "16:10: " + getCheckMessage(MSG_LINE_NEW, ","), + "21:26: " + getCheckMessage(MSG_LINE_NEW, ","), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SingleSpaceSeparatorCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SingleSpaceSeparatorCheckTest.java +index 91b0dbe72..febd519ad 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SingleSpaceSeparatorCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/SingleSpaceSeparatorCheckTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { ++final class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,20 +34,20 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoSpaceErrors() throws Exception { ++ void noSpaceErrors() throws Exception { + verifyWithInlineConfigParser( + getPath("InputSingleSpaceSeparatorNoErrors.java"), CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testNoStackoverflowError() throws Exception { ++ void noStackoverflowError() throws Exception { + verifyWithLimitedResources( + getPath("InputSingleSpaceSeparatorNoStackoverflowError.java"), + CommonUtil.EMPTY_STRING_ARRAY); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final SingleSpaceSeparatorCheck check = new SingleSpaceSeparatorCheck(); + + assertWithMessage("Invalid acceptable tokens") +@@ -56,7 +56,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceErrors() throws Exception { ++ void spaceErrors() throws Exception { + final String[] expected = { + "8:10: " + getCheckMessage(MSG_KEY), + "8:28: " + getCheckMessage(MSG_KEY), +@@ -96,7 +96,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceErrorsAroundComments() throws Exception { ++ void spaceErrorsAroundComments() throws Exception { + final String[] expected = { + "12:11: " + getCheckMessage(MSG_KEY), + "12:43: " + getCheckMessage(MSG_KEY), +@@ -110,7 +110,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceErrorsInChildNodes() throws Exception { ++ void spaceErrorsInChildNodes() throws Exception { + final String[] expected = { + "12:16: " + getCheckMessage(MSG_KEY), + }; +@@ -119,7 +119,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMinColumnNo() throws Exception { ++ void minColumnNo() throws Exception { + final String[] expected = { + "12:4: " + getCheckMessage(MSG_KEY), + }; +@@ -128,7 +128,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceInStartOfTheLine() throws Exception { ++ void whitespaceInStartOfTheLine() throws Exception { + final String[] expected = { + "12:7: " + getCheckMessage(MSG_KEY), + }; +@@ -137,7 +137,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceErrorsIfCommentsIgnored() throws Exception { ++ void spaceErrorsIfCommentsIgnored() throws Exception { + final String[] expected = { + "20:14: " + getCheckMessage(MSG_KEY), + }; +@@ -146,14 +146,14 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmpty() throws Exception { ++ void empty() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + + verifyWithInlineConfigParser(getPath("InputSingleSpaceSeparatorEmpty.java"), expected); + } + + @Test +- public void testSpaceErrorsWithEmoji() throws Exception { ++ void spaceErrorsWithEmoji() throws Exception { + final String[] expected = { + "14:18: " + getCheckMessage(MSG_KEY), + "16:17: " + getCheckMessage(MSG_KEY), +@@ -173,7 +173,7 @@ public class SingleSpaceSeparatorCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpaceErrorsAroundCommentsWithEmoji() throws Exception { ++ void spaceErrorsAroundCommentsWithEmoji() throws Exception { + final String[] expected = { + "25:22: " + getCheckMessage(MSG_KEY), + "25:26: " + getCheckMessage(MSG_KEY), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java +index 64e5aacb5..1dcd75263 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/TypecastParenPadCheckTest.java +@@ -30,7 +30,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { ++final class TypecastParenPadCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,7 +38,7 @@ public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "86:13: " + getCheckMessage(MSG_WS_FOLLOWED, "("), + "86:22: " + getCheckMessage(MSG_WS_PRECEDED, ")"), +@@ -47,7 +47,7 @@ public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSpace() throws Exception { ++ void space() throws Exception { + final String[] expected = { + "84:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "("), + "84:27: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ")"), +@@ -63,13 +63,13 @@ public class TypecastParenPadCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test1322879() throws Exception { ++ void test1322879() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputTypecastParenPadWhitespaceAround.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final TypecastParenPadCheck typecastParenPadCheckObj = new TypecastParenPadCheck(); + final int[] actual = typecastParenPadCheckObj.getAcceptableTokens(); + final int[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java +index f37ca66ae..6434e6212 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAfterCheckTest.java +@@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { ++final class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -35,7 +35,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final WhitespaceAfterCheck checkObj = new WhitespaceAfterCheck(); + assertWithMessage("WhitespaceAfterCheck#getRequiredTokens should return empty array by default") + .that(checkObj.getRequiredTokens()) +@@ -43,7 +43,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] expected = { + "45:39: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), + "74:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), +@@ -52,7 +52,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCast() throws Exception { ++ void cast() throws Exception { + final String[] expected = { + "91:20: " + getCheckMessage(MSG_WS_TYPECAST), + }; +@@ -60,7 +60,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMultilineCast() throws Exception { ++ void multilineCast() throws Exception { + final String[] expected = { + "14:23: " + getCheckMessage(MSG_WS_TYPECAST), + }; +@@ -68,7 +68,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSemi() throws Exception { ++ void semi() throws Exception { + final String[] expected = { + "57:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + "57:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), +@@ -78,7 +78,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralWhile() throws Exception { ++ void literalWhile() throws Exception { + final String[] expected = { + "46:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), + }; +@@ -86,7 +86,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralIf() throws Exception { ++ void literalIf() throws Exception { + final String[] expected = { + "25:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "if"), + }; +@@ -94,7 +94,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralElse() throws Exception { ++ void literalElse() throws Exception { + final String[] expected = { + "34:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "else"), + }; +@@ -102,7 +102,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralFor() throws Exception { ++ void literalFor() throws Exception { + final String[] expected = { + "58:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), + }; +@@ -110,7 +110,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralFinally() throws Exception { ++ void literalFinally() throws Exception { + final String[] expected = { + "14:13: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "finally"), + "17:31: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "finally"), +@@ -119,7 +119,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralReturn() throws Exception { ++ void literalReturn() throws Exception { + final String[] expected = { + "17:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "return"), + "21:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "return"), +@@ -130,7 +130,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralDo() throws Exception { ++ void literalDo() throws Exception { + final String[] expected = { + "70:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "do"), + }; +@@ -138,7 +138,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralYield() throws Exception { ++ void literalYield() throws Exception { + final String[] expected = { + "17:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "yield"), + }; +@@ -147,7 +147,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralSynchronized() throws Exception { ++ void literalSynchronized() throws Exception { + final String[] expected = { + "13:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "synchronized"), + "31:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "synchronized"), +@@ -157,7 +157,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDoWhile() throws Exception { ++ void doWhile() throws Exception { + final String[] expected = { + "25:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), + }; +@@ -165,7 +165,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralTry() throws Exception { ++ void literalTry() throws Exception { + final String[] expected = { + "20:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "try"), + "24:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "try"), +@@ -174,7 +174,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralCatch() throws Exception { ++ void literalCatch() throws Exception { + final String[] expected = { + "14:14: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "catch"), + }; +@@ -182,7 +182,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralCase() throws Exception { ++ void literalCase() throws Exception { + final String[] expected = { + "15:13: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "case"), + }; +@@ -190,7 +190,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralCase2() throws Exception { ++ void literalCase2() throws Exception { + final String[] expected = { + "13:13: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "case"), + }; +@@ -198,7 +198,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyForIterator() throws Exception { ++ void emptyForIterator() throws Exception { + final String[] expected = { + "18:30: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + "21:30: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), +@@ -207,7 +207,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTypeArgumentAndParameterCommas() throws Exception { ++ void typeArgumentAndParameterCommas() throws Exception { + final String[] expected = { + "20:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), + "20:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), +@@ -217,13 +217,13 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test1322879() throws Exception { ++ void test1322879() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputWhitespaceAfterAround.java"), expected); + } + + @Test +- public void testCountUnicodeCorrectly() throws Exception { ++ void countUnicodeCorrectly() throws Exception { + final String[] expected = { + "14:20: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ";"), + }; +@@ -232,7 +232,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVarargs() throws Exception { ++ void varargs() throws Exception { + final String[] expected = { + "14:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "..."), + "18:25: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "..."), +@@ -244,7 +244,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchStatements() throws Exception { ++ void switchStatements() throws Exception { + final String[] expected = { + "18:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "switch"), + "31:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "switch"), +@@ -260,7 +260,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaExpressions() throws Exception { ++ void lambdaExpressions() throws Exception { + final String[] expected = { + "17:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "->"), + "19:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "->"), +@@ -271,7 +271,7 @@ public class WhitespaceAfterCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAfterWithEmoji() throws Exception { ++ void whitespaceAfterWithEmoji() throws Exception { + final String[] expected = { + "13:48: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), + "13:52: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, ","), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java +index 082b4c819..9efcaabb0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/checks/whitespace/WhitespaceAroundCheckTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { ++final class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGetRequiredTokens() { ++ void getRequiredTokens() { + final WhitespaceAroundCheck checkObj = new WhitespaceAroundCheck(); + assertWithMessage( + "WhitespaceAroundCheck#getRequiredTokens should return empty array by default") +@@ -45,7 +45,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testKeywordsAndOperators() throws Exception { ++ void keywordsAndOperators() throws Exception { + final String[] expected = { + "32:22: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "="), + "32:22: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), +@@ -93,7 +93,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSimpleInput() throws Exception { ++ void simpleInput() throws Exception { + final String[] expected = { + "168:26: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), + "169:26: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "="), +@@ -106,7 +106,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStartOfTheLine() throws Exception { ++ void startOfTheLine() throws Exception { + final String[] expected = { + "25:2: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + }; +@@ -114,7 +114,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBraces() throws Exception { ++ void braces() throws Exception { + final String[] expected = { + "53:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), + "70:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), +@@ -133,7 +133,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBracesInMethodsAndConstructors() throws Exception { ++ void bracesInMethodsAndConstructors() throws Exception { + final String[] expected = { + "53:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), + "70:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "for"), +@@ -146,7 +146,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArrayInitialization() throws Exception { ++ void arrayInitialization() throws Exception { + final String[] expected = { + "21:39: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "25:37: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), +@@ -162,7 +162,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testGenericsTokensAreFlagged() throws Exception { ++ void genericsTokensAreFlagged() throws Exception { + final String[] expected = { + "27:16: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "&"), + "27:16: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "&"), +@@ -171,13 +171,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void test1322879And1649038() throws Exception { ++ void test1322879And1649038() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputWhitespaceAround1.java"), expected); + } + + @Test +- public void testAllowDoubleBraceInitialization() throws Exception { ++ void allowDoubleBraceInitialization() throws Exception { + final String[] expected = { + "31:33: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), + "32:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), +@@ -191,7 +191,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIgnoreEnhancedForColon() throws Exception { ++ void ignoreEnhancedForColon() throws Exception { + final String[] expected = { + "39:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, ":"), + }; +@@ -199,7 +199,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyTypes() throws Exception { ++ void emptyTypes() throws Exception { + final String[] expected = { + "45:94: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "45:95: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), +@@ -213,7 +213,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyLoops() throws Exception { ++ void emptyLoops() throws Exception { + final String[] expected = { + "56:65: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "56:66: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), +@@ -231,7 +231,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchWhitespaceAround() throws Exception { ++ void switchWhitespaceAround() throws Exception { + final String[] expected = { + "26:9: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "switch"), + }; +@@ -239,7 +239,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDoWhileWhitespaceAround() throws Exception { ++ void doWhileWhitespaceAround() throws Exception { + final String[] expected = { + "29:11: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), + }; +@@ -247,13 +247,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void allowEmptyMethods() throws Exception { ++ void allowEmptyMethods() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputWhitespaceAround3.java"), expected); + } + + @Test +- public void testGetAcceptableTokens() { ++ void getAcceptableTokens() { + final WhitespaceAroundCheck whitespaceAroundCheckObj = new WhitespaceAroundCheck(); + final int[] actual = whitespaceAroundCheckObj.getAcceptableTokens(); + final int[] expected = { +@@ -318,7 +318,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowEmptyTypesIsSetToFalseAndNonEmptyClasses() throws Exception { ++ void allowEmptyTypesIsSetToFalseAndNonEmptyClasses() throws Exception { + final String[] expected = { + "31:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "35:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), +@@ -341,7 +341,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowEmptyTypesIsSetToTrueAndNonEmptyClasses() throws Exception { ++ void allowEmptyTypesIsSetToTrueAndNonEmptyClasses() throws Exception { + final String[] expected = { + "30:20: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), + "34:32: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "{"), +@@ -360,7 +360,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNotAllowEmptyLambdaExpressionsByDefault() throws Exception { ++ void notAllowEmptyLambdaExpressionsByDefault() throws Exception { + final String[] expected = { + "27:27: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "27:28: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), +@@ -374,7 +374,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllowEmptyLambdaExpressionsWithAllowEmptyLambdaParameter() throws Exception { ++ void allowEmptyLambdaExpressionsWithAllowEmptyLambdaParameter() throws Exception { + final String[] expected = { + "32:28: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "32:30: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), +@@ -386,7 +386,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundLambda() throws Exception { ++ void whitespaceAroundLambda() throws Exception { + final String[] expected = { + "28:48: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "->"), + "28:48: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "->"), +@@ -395,13 +395,13 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundEmptyCatchBlock() throws Exception { ++ void whitespaceAroundEmptyCatchBlock() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputWhitespaceAroundCatch.java"), expected); + } + + @Test +- public void testWhitespaceAroundVarargs() throws Exception { ++ void whitespaceAroundVarargs() throws Exception { + final String[] expected = { + "19:29: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "..."), + "20:37: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "..."), +@@ -416,7 +416,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundRecords() throws Exception { ++ void whitespaceAroundRecords() throws Exception { + final String[] expected = { + "26:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "26:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), +@@ -445,7 +445,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundAllowEmptyCompactCtors() throws Exception { ++ void whitespaceAroundAllowEmptyCompactCtors() throws Exception { + final String[] expected = { + "26:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "{"), + "26:24: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "}"), +@@ -474,14 +474,14 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundRecordsAllowEmptyTypes() throws Exception { ++ void whitespaceAroundRecordsAllowEmptyTypes() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputWhitespaceAroundRecordsAllowEmptyTypes.java"), expected); + } + + @Test +- public void testWhitespaceAroundAllTokens() throws Exception { ++ void whitespaceAroundAllTokens() throws Exception { + final String[] expected = { + "27:29: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "<"), + "27:29: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "<"), +@@ -497,7 +497,7 @@ public class WhitespaceAroundCheckTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWhitespaceAroundAfterEmoji() throws Exception { ++ void whitespaceAroundAfterEmoji() throws Exception { + final String[] expected = { + "25:22: " + getCheckMessage(MSG_WS_NOT_PRECEDED, "+"), + "26:23: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "+"), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filefilters/BeforeExecutionExclusionFileFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filefilters/BeforeExecutionExclusionFileFilterTest.java +index bd41106f9..13309bb5b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filefilters/BeforeExecutionExclusionFileFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filefilters/BeforeExecutionExclusionFileFilterTest.java +@@ -28,7 +28,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.util.regex.Pattern; + import org.junit.jupiter.api.Test; + +-public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSupport { ++final class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -36,7 +36,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testAccept() { ++ void accept() { + final String fileName = "BAD"; + final BeforeExecutionExclusionFileFilter filter = + createExclusionBeforeExecutionFileFilter(fileName); +@@ -47,7 +47,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testAcceptOnNullFile() { ++ void acceptOnNullFile() { + final String fileName = null; + final BeforeExecutionExclusionFileFilter filter = + createExclusionBeforeExecutionFileFilter(fileName); +@@ -56,7 +56,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testReject() { ++ void reject() { + final String fileName = "Test"; + final BeforeExecutionExclusionFileFilter filter = + createExclusionBeforeExecutionFileFilter(fileName); +@@ -67,7 +67,7 @@ public class BeforeExecutionExclusionFileFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testFileExclusion() throws Exception { ++ void fileExclusion() throws Exception { + final String[] filteredViolations = CommonUtil.EMPTY_STRING_ARRAY; + + final String[] unfilteredViolations = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElementTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElementTest.java +index 5fc8c850e..3a4523dd2 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElementTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/CsvFilterElementTest.java +@@ -25,10 +25,10 @@ import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + +-public class CsvFilterElementTest { ++final class CsvFilterElementTest { + + @Test +- public void testDecideSingle() { ++ void decideSingle() { + final IntFilterElement filter = new CsvFilterElement("0"); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("equal").that(filter.accept(0)).isTrue(); +@@ -36,7 +36,7 @@ public class CsvFilterElementTest { + } + + @Test +- public void testDecidePair() { ++ void decidePair() { + final IntFilterElement filter = new CsvFilterElement("0, 2"); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("equal 0").that(filter.accept(0)).isTrue(); +@@ -45,7 +45,7 @@ public class CsvFilterElementTest { + } + + @Test +- public void testDecideRange() { ++ void decideRange() { + final IntFilterElement filter = new CsvFilterElement("0-2"); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("equal 0").that(filter.accept(0)).isTrue(); +@@ -55,7 +55,7 @@ public class CsvFilterElementTest { + } + + @Test +- public void testDecideEmptyRange() { ++ void decideEmptyRange() { + final IntFilterElement filter = new CsvFilterElement("2-0"); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("equal 0").that(filter.accept(0)).isFalse(); +@@ -65,7 +65,7 @@ public class CsvFilterElementTest { + } + + @Test +- public void testDecideRangePlusValue() { ++ void decideRangePlusValue() { + final IntFilterElement filter = new CsvFilterElement("0-2, 10"); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("equal 0").that(filter.accept(0)).isTrue(); +@@ -76,13 +76,13 @@ public class CsvFilterElementTest { + } + + @Test +- public void testEmptyChain() { ++ void emptyChain() { + final CsvFilterElement filter = new CsvFilterElement(""); + assertWithMessage("0").that(filter.accept(0)).isFalse(); + } + + @Test +- public void testEqualsAndHashCode() { ++ void equalsAndHashCode() { + final EqualsVerifierReport ev = + EqualsVerifier.forClass(CsvFilterElement.class).usingGetClass().report(); + assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterElementTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterElementTest.java +index 11fe4d56c..e2cce1844 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterElementTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntMatchFilterElementTest.java +@@ -25,10 +25,10 @@ import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + +-public class IntMatchFilterElementTest { ++final class IntMatchFilterElementTest { + + @Test +- public void testDecide() { ++ void decide() { + final IntFilterElement filter = new IntMatchFilterElement(0); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("equal").that(filter.accept(0)).isTrue(); +@@ -36,13 +36,13 @@ public class IntMatchFilterElementTest { + } + + @Test +- public void testEqualsAndHashCode() { ++ void equalsAndHashCode() { + final EqualsVerifierReport ev = EqualsVerifier.forClass(IntMatchFilterElement.class).report(); + assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); + } + + @Test +- public void testToString() { ++ void testToString() { + final IntFilterElement filter = new IntMatchFilterElement(6); + assertWithMessage("Invalid toString result") + .that(filter.toString()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterElementTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterElementTest.java +index 73662d0df..2021a2a58 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterElementTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/IntRangeFilterElementTest.java +@@ -25,10 +25,10 @@ import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + +-public class IntRangeFilterElementTest { ++final class IntRangeFilterElementTest { + + @Test +- public void testDecide() { ++ void decide() { + final IntFilterElement filter = new IntRangeFilterElement(0, 10); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("in range").that(filter.accept(0)).isTrue(); +@@ -38,7 +38,7 @@ public class IntRangeFilterElementTest { + } + + @Test +- public void testDecideSingle() { ++ void decideSingle() { + final IntFilterElement filter = new IntRangeFilterElement(0, 0); + assertWithMessage("less than").that(filter.accept(-1)).isFalse(); + assertWithMessage("in range").that(filter.accept(0)).isTrue(); +@@ -46,7 +46,7 @@ public class IntRangeFilterElementTest { + } + + @Test +- public void testDecideEmpty() { ++ void decideEmpty() { + final IntFilterElement filter = new IntRangeFilterElement(10, 0); + assertWithMessage("out").that(filter.accept(-1)).isFalse(); + assertWithMessage("out").that(filter.accept(0)).isFalse(); +@@ -56,7 +56,7 @@ public class IntRangeFilterElementTest { + } + + @Test +- public void testEqualsAndHashCode() { ++ void equalsAndHashCode() { + final EqualsVerifierReport ev = + EqualsVerifier.forClass(IntRangeFilterElement.class).usingGetClass().report(); + assertWithMessage("Error: " + ev.getMessage()).that(ev.isSuccessful()).isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java +index b46ac5425..c23b0e35f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SeverityMatchFilterTest.java +@@ -28,12 +28,12 @@ import com.puppycrawl.tools.checkstyle.api.SeverityLevel; + import com.puppycrawl.tools.checkstyle.api.Violation; + import org.junit.jupiter.api.Test; + +-public class SeverityMatchFilterTest { ++final class SeverityMatchFilterTest { + + private final SeverityMatchFilter filter = new SeverityMatchFilter(); + + @Test +- public void testDefault() { ++ void testDefault() { + final AuditEvent ev = new AuditEvent(this, "Test.java"); + assertWithMessage("no message").that(filter.accept(ev)).isFalse(); + final SeverityLevel errorLevel = SeverityLevel.ERROR; +@@ -49,7 +49,7 @@ public class SeverityMatchFilterTest { + } + + @Test +- public void testSeverity() { ++ void severity() { + filter.setSeverity(SeverityLevel.INFO); + final AuditEvent ev = new AuditEvent(this, "Test.java"); + // event with no message has severity level INFO +@@ -67,7 +67,7 @@ public class SeverityMatchFilterTest { + } + + @Test +- public void testAcceptOnMatch() { ++ void acceptOnMatch() { + filter.setSeverity(SeverityLevel.INFO); + filter.setAcceptOnMatch(false); + final AuditEvent ev = new AuditEvent(this, "Test.java"); +@@ -86,7 +86,7 @@ public class SeverityMatchFilterTest { + } + + @Test +- public void testConfigure() throws CheckstyleException { ++ void configure() throws CheckstyleException { + filter.configure(new DefaultConfiguration("test")); + assertWithMessage("object exists").that(filter).isNotNull(); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressFilterElementTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressFilterElementTest.java +index 38f754bbf..0d811d80d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressFilterElementTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressFilterElementTest.java +@@ -30,23 +30,23 @@ import nl.jqno.equalsverifier.Warning; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class SuppressFilterElementTest { ++final class SuppressFilterElementTest { + + private SuppressFilterElement filter; + + @BeforeEach +- public void setUp() { ++ void setUp() { + filter = new SuppressFilterElement("Test", "Test", null, null, null, null); + } + + @Test +- public void testDecideDefault() { ++ void decideDefault() { + final AuditEvent ev = new AuditEvent(this, "Test.java"); + assertWithMessage(ev.getFileName()).that(filter.accept(ev)).isTrue(); + } + + @Test +- public void testDecideViolation() { ++ void decideViolation() { + final Violation violation = new Violation(1, 0, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", violation); + // deny because there are matches on file and check names +@@ -54,7 +54,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByMessage() { ++ void decideByMessage() { + final Violation violation = new Violation(1, 0, "", "", null, null, getClass(), "Test"); + final AuditEvent ev = new AuditEvent(this, "ATest.java", violation); + final SuppressFilterElement filter1 = +@@ -66,7 +66,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByLine() { ++ void decideByLine() { + final Violation violation = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", violation); + final SuppressFilterElement filter1 = +@@ -82,7 +82,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByColumn() { ++ void decideByColumn() { + final Violation violation = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", violation); + final SuppressFilterElement filter1 = +@@ -96,27 +96,27 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByFileNameAndModuleMatchingFileNameNull() { ++ void decideByFileNameAndModuleMatchingFileNameNull() { + final Violation message = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, null, message); + assertWithMessage("Filter should accept valid event").that(filter.accept(ev)).isTrue(); + } + + @Test +- public void testDecideByFileNameAndModuleMatchingMessageNull() { ++ void decideByFileNameAndModuleMatchingMessageNull() { + final AuditEvent ev = new AuditEvent(this, "ATest.java", null); + assertWithMessage("Filter should accept valid event").that(filter.accept(ev)).isTrue(); + } + + @Test +- public void testDecideByFileNameAndModuleMatchingModuleNull() { ++ void decideByFileNameAndModuleMatchingModuleNull() { + final Violation violation = new Violation(10, 10, "", "", null, "MyModule", getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", violation); + assertWithMessage("Filter should not accept invalid event").that(filter.accept(ev)).isFalse(); + } + + @Test +- public void testDecideByFileNameAndModuleMatchingModuleEqual() { ++ void decideByFileNameAndModuleMatchingModuleEqual() { + final Violation violation = new Violation(10, 10, "", "", null, "MyModule", getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", violation); + final SuppressFilterElement myFilter = +@@ -126,7 +126,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByFileNameAndModuleMatchingModuleNotEqual() { ++ void decideByFileNameAndModuleMatchingModuleNotEqual() { + final Violation message = new Violation(10, 10, "", "", null, "TheirModule", getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", message); + final SuppressFilterElement myFilter = +@@ -136,14 +136,14 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByFileNameAndModuleMatchingRegExpNotMatch() { ++ void decideByFileNameAndModuleMatchingRegExpNotMatch() { + final Violation message = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "T1est", message); + assertWithMessage("Filter should accept valid event").that(filter.accept(ev)).isTrue(); + } + + @Test +- public void testDecideByFileNameAndModuleMatchingRegExpMatch() { ++ void decideByFileNameAndModuleMatchingRegExpMatch() { + final Violation message = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "TestSUFFIX", message); + final SuppressFilterElement myFilter = +@@ -152,7 +152,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByFileNameAndModuleMatchingCheckRegExpNotMatch() { ++ void decideByFileNameAndModuleMatchingCheckRegExpNotMatch() { + final Violation message = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", message); + final SuppressFilterElement myFilter = +@@ -161,7 +161,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByFileNameAndModuleMatchingCheckRegExpMatch() { ++ void decideByFileNameAndModuleMatchingCheckRegExpMatch() { + final Violation message = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", message); + final SuppressFilterElement myFilter = +@@ -171,7 +171,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testDecideByFileNameAndSourceNameCheckRegExpNotMatch() { ++ void decideByFileNameAndSourceNameCheckRegExpNotMatch() { + final Violation message = new Violation(10, 10, "", "", null, null, getClass(), null); + final AuditEvent ev = new AuditEvent(this, "ATest.java", message); + final SuppressFilterElement myFilter = +@@ -182,7 +182,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testEquals() { ++ void testEquals() { + // filterBased is used instead of filter field only to satisfy IntelliJ IDEA Inspection + // Inspection "Arguments to assertEquals() in wrong order " + final SuppressFilterElement filterBased = +@@ -213,7 +213,7 @@ public class SuppressFilterElementTest { + } + + @Test +- public void testEqualsAndHashCode() { ++ void equalsAndHashCode() { + final EqualsVerifierReport ev = + EqualsVerifier.forClass(SuppressFilterElement.class) + .usingGetClass() +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java +index 3e037819e..4d3208c9c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWarningsFilterTest.java +@@ -31,7 +31,7 @@ import com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class SuppressWarningsFilterTest extends AbstractModuleTestSupport { ++final class SuppressWarningsFilterTest extends AbstractModuleTestSupport { + + private static final String[] ALL_MESSAGES = { + "48:5: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), +@@ -73,14 +73,14 @@ public class SuppressWarningsFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNone() throws Exception { ++ void none() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser( + getPath("InputSuppressWarningsFilterWithoutFilter.java"), suppressed); + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] suppressed = { + "56:17: " + + getCheckMessage( +@@ -102,7 +102,7 @@ public class SuppressWarningsFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressById() throws Exception { ++ void suppressById() throws Exception { + final String[] suppressedViolationMessages = { + "49:17: " + + getCheckMessage( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java +index eebd0a734..549f53c3f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithNearbyCommentFilterTest.java +@@ -22,6 +22,7 @@ package com.puppycrawl.tools.checkstyle.filters; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; + import com.puppycrawl.tools.checkstyle.TreeWalker; +@@ -37,13 +38,12 @@ import com.puppycrawl.tools.checkstyle.internal.utils.TestUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.io.File; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + +-public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSupport { ++final class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSupport { + + private static final String[] ALL_MESSAGES = { + "46:17: " +@@ -126,7 +126,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testNone() throws Exception { ++ void none() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + final String[] expected = { + "36:17: " +@@ -207,7 +207,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] suppressed = { + "46:17: " + + getCheckMessage( +@@ -235,7 +235,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testCheckC() throws Exception { ++ void checkC() throws Exception { + final String[] suppressed = { + "46:17: " + + getCheckMessage( +@@ -249,7 +249,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testCheckCpp() throws Exception { ++ void checkCpp() throws Exception { + final String[] suppressed = { + "49:17: " + + getCheckMessage( +@@ -272,7 +272,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testUsingVariableMessage() throws Exception { ++ void usingVariableMessage() throws Exception { + final String[] suppressed = { + "102:23: " + getCheckMessage(IllegalCatchCheck.class, IllegalCatchCheck.MSG_KEY, "Throwable"), + "109:11: " + getCheckMessage(IllegalCatchCheck.class, IllegalCatchCheck.MSG_KEY, "Exception"), +@@ -282,7 +282,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testUsingNonMatchingVariableMessage() throws Exception { ++ void usingNonMatchingVariableMessage() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser( + getPath("InputSuppressWithNearbyCommentFilterUsingNonMatchingVariableMessage.java"), +@@ -290,7 +290,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testUsingVariableCheckOnNextLine() throws Exception { ++ void usingVariableCheckOnNextLine() throws Exception { + final String[] suppressed = { + "61:17: " + + getCheckMessage( +@@ -302,7 +302,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testUsingVariableCheckOnPreviousLine() throws Exception { ++ void usingVariableCheckOnPreviousLine() throws Exception { + final String[] suppressed = { + "65:17: " + + getCheckMessage( +@@ -314,7 +314,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testVariableCheckOnVariableNumberOfLines() throws Exception { ++ void variableCheckOnVariableNumberOfLines() throws Exception { + final String[] suppressed = { + "74:30: " + + getCheckMessage( +@@ -336,7 +336,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testEqualsAndHashCodeOfTagClass() { ++ void equalsAndHashCodeOfTagClass() { + final SuppressWithNearbyCommentFilter filter = new SuppressWithNearbyCommentFilter(); + final Object tag = + getTagsAfterExecution(filter, "filename", "//SUPPRESS CHECKSTYLE ignore").get(0); +@@ -356,7 +356,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testInvalidInfluenceFormat() throws Exception { ++ void invalidInfluenceFormat() throws Exception { + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); + final DefaultConfiguration filterConfig = + createModuleConfig(SuppressWithNearbyCommentFilter.class); +@@ -381,7 +381,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testInfluenceFormat() throws Exception { ++ void influenceFormat() throws Exception { + final String[] suppressed = { + "46:17: " + + getCheckMessage( +@@ -413,7 +413,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testInvalidCheckFormat() throws Exception { ++ void invalidCheckFormat() throws Exception { + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); + final DefaultConfiguration filterConfig = + createModuleConfig(SuppressWithNearbyCommentFilter.class); +@@ -437,12 +437,11 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testAcceptNullViolation() { ++ void acceptNullViolation() { + final SuppressWithNearbyCommentFilter filter = new SuppressWithNearbyCommentFilter(); + final FileContents contents = + new FileContents( +- new FileText( +- new File("filename"), Collections.singletonList("//SUPPRESS CHECKSTYLE ignore"))); ++ new FileText(new File("filename"), ImmutableList.of("//SUPPRESS CHECKSTYLE ignore"))); + contents.reportSingleLineComment(1, 0); + final TreeWalkerAuditEvent auditEvent = new TreeWalkerAuditEvent(contents, null, null, null); + assertWithMessage("Filter should accept null violation") +@@ -451,7 +450,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testAcceptNullFileContents() { ++ void acceptNullFileContents() { + final SuppressWithNearbyCommentFilter filter = new SuppressWithNearbyCommentFilter(); + final FileContents contents = null; + final TreeWalkerAuditEvent auditEvent = +@@ -461,7 +460,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testToStringOfTagClass() { ++ void toStringOfTagClass() { + final SuppressWithNearbyCommentFilter filter = new SuppressWithNearbyCommentFilter(); + final Object tag = + getTagsAfterExecution(filter, "filename", "//SUPPRESS CHECKSTYLE ignore").get(0); +@@ -473,7 +472,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testToStringOfTagClassWithId() { ++ void toStringOfTagClassWithId() { + final SuppressWithNearbyCommentFilter filter = new SuppressWithNearbyCommentFilter(); + filter.setIdFormat(".*"); + final Object tag = +@@ -486,14 +485,14 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testUsingTagMessageRegexp() throws Exception { ++ void usingTagMessageRegexp() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser( + getPath("InputSuppressWithNearbyCommentFilterUsingTagMessageRegexp.java"), suppressed); + } + + @Test +- public void testSuppressByCheck() throws Exception { ++ void suppressByCheck() throws Exception { + final String[] suppressedViolationMessages = { + "41:17: " + + getCheckMessage( +@@ -536,7 +535,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testSuppressById() throws Exception { ++ void suppressById() throws Exception { + final String[] suppressedViolationMessages = { + "41:17: " + + getCheckMessage( +@@ -579,7 +578,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testSuppressByCheckAndId() throws Exception { ++ void suppressByCheckAndId() throws Exception { + final String[] suppressedViolationMessages = { + "41:17: " + + getCheckMessage( +@@ -622,7 +621,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testSuppressByCheckAndNonMatchingId() throws Exception { ++ void suppressByCheckAndNonMatchingId() throws Exception { + final String[] suppressedViolationMessages = CommonUtil.EMPTY_STRING_ARRAY; + final String[] expectedViolationMessages = { + "41:17: " +@@ -655,7 +654,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void tesSuppressByIdAndMessage() throws Exception { ++ void tesSuppressByIdAndMessage() throws Exception { + final String[] suppressedViolationMessages = { + "55:17: " + + getCheckMessage( +@@ -692,7 +691,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void tesSuppressByCheckAndMessage() throws Exception { ++ void tesSuppressByCheckAndMessage() throws Exception { + final String[] suppressedViolationMessages = { + "55:17: " + + getCheckMessage( +@@ -729,7 +728,7 @@ public class SuppressWithNearbyCommentFilterTest extends AbstractModuleTestSuppo + } + + @Test +- public void testTagsAreClearedEachRun() { ++ void tagsAreClearedEachRun() { + final SuppressWithNearbyCommentFilter suppressionCommentFilter = + new SuppressWithNearbyCommentFilter(); + final List tags1 = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterTest.java +index 89013ee0f..ac049bcae 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressWithPlainTextCommentFilterTest.java +@@ -46,7 +46,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + +-public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSupport { ++final class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSupport { + + private static final String MSG_REGEXP_EXCEEDED = "regexp.exceeded"; + +@@ -56,7 +56,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testFilterWithDefaultConfig() throws Exception { ++ void filterWithDefaultConfig() throws Exception { + final String[] suppressed = { + "20:7: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), + "28:1: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), +@@ -75,7 +75,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testChangeOffAndOnFormat() throws Exception { ++ void changeOffAndOnFormat() throws Exception { + final String[] suppressed = { + "20:7: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), + "27:30: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), +@@ -95,7 +95,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressionCommentsInXmlFile() throws Exception { ++ void suppressionCommentsInXmlFile() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("offCommentFormat", "CS-OFF"); +@@ -121,7 +121,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressionCommentsInPropertiesFile() throws Exception { ++ void suppressionCommentsInPropertiesFile() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("offCommentFormat", "# CHECKSTYLE:OFF"); +@@ -147,7 +147,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressionCommentsInSqlFile() throws Exception { ++ void suppressionCommentsInSqlFile() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("offCommentFormat", "-- CHECKSTYLE OFF"); +@@ -173,7 +173,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressionCommentsInJavaScriptFile() throws Exception { ++ void suppressionCommentsInJavaScriptFile() throws Exception { + final String[] suppressed = { + "22: " + getCheckMessage(RegexpSinglelineCheck.class, MSG_REGEXP_EXCEEDED, ".*\\s===.*"), + }; +@@ -190,7 +190,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testInvalidCheckFormat() throws Exception { ++ void invalidCheckFormat() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("checkFormat", "e[l"); +@@ -225,7 +225,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testInvalidIdFormat() throws Exception { ++ void invalidIdFormat() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("idFormat", "e[l"); +@@ -252,7 +252,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testInvalidMessageFormat() throws Exception { ++ void invalidMessageFormat() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("messageFormat", "e[l"); +@@ -287,7 +287,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testInvalidMessageFormatInSqlFile() throws Exception { ++ void invalidMessageFormatInSqlFile() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("onCommentFormat", "CSON (\\w+)"); +@@ -321,7 +321,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testAcceptNullViolation() { ++ void acceptNullViolation() { + final SuppressWithPlainTextCommentFilter filter = new SuppressWithPlainTextCommentFilter(); + final AuditEvent auditEvent = new AuditEvent(this); + assertWithMessage("Filter should accept audit event").that(filter.accept(auditEvent)).isTrue(); +@@ -334,7 +334,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + * the inner type {@code Suppression} here. + */ + @Test +- public void testEqualsAndHashCodeOfSuppressionClass() throws ClassNotFoundException { ++ void equalsAndHashCodeOfSuppressionClass() throws ClassNotFoundException { + final Class suppressionClass = + TestUtil.getInnerClassType(SuppressWithPlainTextCommentFilter.class, "Suppression"); + final EqualsVerifierReport ev = +@@ -343,7 +343,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressByCheck() throws Exception { ++ void suppressByCheck() throws Exception { + final String[] suppressedViolationMessages = { + "36:1: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), + }; +@@ -367,7 +367,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressByModuleId() throws Exception { ++ void suppressByModuleId() throws Exception { + final String[] suppressedViolationMessages = { + "33: " + + getCheckMessage(RegexpSinglelineCheck.class, MSG_REGEXP_EXCEEDED, ".*[a-zA-Z][0-9].*"), +@@ -398,7 +398,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressByCheckAndModuleId() throws Exception { ++ void suppressByCheckAndModuleId() throws Exception { + final String[] suppressedViolationMessages = { + "36:1: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), + }; +@@ -424,7 +424,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressByCheckAndNonMatchingModuleId() throws Exception { ++ void suppressByCheckAndNonMatchingModuleId() throws Exception { + final String[] suppressedViolationMessages = CommonUtil.EMPTY_STRING_ARRAY; + + final String[] expectedViolationMessages = { +@@ -448,7 +448,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressByModuleIdWithNullModuleId() throws Exception { ++ void suppressByModuleIdWithNullModuleId() throws Exception { + final String[] suppressedViolationMessages = { + "33: " + + getCheckMessage(RegexpSinglelineCheck.class, MSG_REGEXP_EXCEEDED, ".*[a-zA-Z][0-9].*"), +@@ -479,7 +479,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testSuppressedByIdJavadocCheck() throws Exception { ++ void suppressedByIdJavadocCheck() throws Exception { + final String[] suppressedViolationMessages = { + "28: " + getCheckMessage(JavadocMethodCheck.class, MSG_RETURN_EXPECTED), + "32:9: " + getCheckMessage(JavadocMethodCheck.class, MSG_UNUSED_TAG, "@param", "unused"), +@@ -499,7 +499,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testAcceptThrowsIllegalStateExceptionAsFileNotFound() { ++ void acceptThrowsIllegalStateExceptionAsFileNotFound() { + final Violation message = + new Violation( + 1, +@@ -538,7 +538,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testFilterWithCustomMessageFormat() throws Exception { ++ void filterWithCustomMessageFormat() throws Exception { + final String[] suppressed = { + "34:1: " + getCheckMessage(FileTabCharacterCheck.class, MSG_CONTAINS_TAB), + }; +@@ -562,7 +562,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testFilterWithIdAndCustomMessageFormat() throws Exception { ++ void filterWithIdAndCustomMessageFormat() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("offCommentFormat", "CHECKSTYLE stop (\\w+) (\\w+)"); +@@ -600,7 +600,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testFilterWithCheckAndCustomMessageFormat() throws Exception { ++ void filterWithCheckAndCustomMessageFormat() throws Exception { + final DefaultConfiguration filterCfg = + createModuleConfig(SuppressWithPlainTextCommentFilter.class); + filterCfg.addProperty("offCommentFormat", "CHECKSTYLE stop (\\w+) (\\w+)"); +@@ -638,7 +638,7 @@ public class SuppressWithPlainTextCommentFilterTest extends AbstractModuleTestSu + } + + @Test +- public void testFilterWithDirectory() throws IOException { ++ void filterWithDirectory() throws IOException { + final SuppressWithPlainTextCommentFilter filter = new SuppressWithPlainTextCommentFilter(); + final AuditEvent event = + new AuditEvent( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java +index 6c14f0415..25b797ffa 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilterTest.java +@@ -42,7 +42,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.Test; + +-public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { ++final class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + + private static final String[] ALL_MESSAGES = { + "45:17: " +@@ -87,7 +87,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNone() throws Exception { ++ void none() throws Exception { + final String[] messages = { + "35:17: " + + getCheckMessage( +@@ -139,7 +139,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + + // Suppress all checks between default comments + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] suppressed = { + "48:17: " + + getCheckMessage( +@@ -155,7 +155,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckC() throws Exception { ++ void checkC() throws Exception { + final String[] suppressed = { + "75:17: " + + getCheckMessage( +@@ -167,7 +167,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCheckCpp() throws Exception { ++ void checkCpp() throws Exception { + final String[] suppressed = { + "48:17: " + + getCheckMessage( +@@ -179,7 +179,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + + // Suppress all checks between CS_OFF and CS_ON + @Test +- public void testOffFormat() throws Exception { ++ void offFormat() throws Exception { + final String[] suppressed = { + "64:17: " + + getCheckMessage( +@@ -200,7 +200,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + // Test suppression of checks of only one type + // Suppress only ConstantNameCheck between CS_OFF and CS_ON + @Test +- public void testOffFormatCheck() throws Exception { ++ void offFormatCheck() throws Exception { + final String[] suppressed = { + "71:30: " + + getCheckMessage( +@@ -210,7 +210,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testArgumentSuppression() throws Exception { ++ void argumentSuppression() throws Exception { + final String[] suppressed = { + "110:11: " + getCheckMessage(IllegalCatchCheck.class, IllegalCatchCheck.MSG_KEY, "Exception"), + }; +@@ -218,7 +218,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpansion() throws Exception { ++ void expansion() throws Exception { + final String[] suppressed = { + "54:17: " + + getCheckMessage( +@@ -234,7 +234,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMessage() throws Exception { ++ void message() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser("InputSuppressionCommentFilter9.java", suppressed); + } +@@ -250,7 +250,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsAndHashCodeOfTagClass() { ++ void equalsAndHashCodeOfTagClass() { + final Object tag = getTagsAfterExecutionOnDefaultFilter("//CHECKSTYLE:OFF").get(0); + final EqualsVerifierReport ev = + EqualsVerifier.forClass(tag.getClass()).usingGetClass().report(); +@@ -258,7 +258,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testToStringOfTagClass() { ++ void toStringOfTagClass() { + final Object tag = getTagsAfterExecutionOnDefaultFilter("//CHECKSTYLE:OFF").get(0); + assertWithMessage("Invalid toString result") + .that(tag.toString()) +@@ -268,7 +268,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testToStringOfTagClassWithMessage() { ++ void toStringOfTagClassWithMessage() { + final SuppressionCommentFilter filter = new SuppressionCommentFilter(); + filter.setMessageFormat(".*"); + final Object tag = getTagsAfterExecution(filter, "filename", "//CHECKSTYLE:ON").get(0); +@@ -280,7 +280,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCompareToOfTagClass() { ++ void compareToOfTagClass() { + final List> tags1 = + getTagsAfterExecutionOnDefaultFilter("//CHECKSTYLE:OFF", " //CHECKSTYLE:ON"); + final Comparable tag1 = tags1.get(0); +@@ -302,7 +302,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidCheckFormat() throws Exception { ++ void invalidCheckFormat() throws Exception { + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); + final DefaultConfiguration filterConfig = createModuleConfig(SuppressionCommentFilter.class); + filterConfig.addProperty("checkFormat", "e[l"); +@@ -323,7 +323,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidMessageFormat() throws Exception { ++ void invalidMessageFormat() throws Exception { + final DefaultConfiguration treeWalkerConfig = createModuleConfig(TreeWalker.class); + final DefaultConfiguration filterConfig = createModuleConfig(SuppressionCommentFilter.class); + filterConfig.addProperty("messageFormat", "e[l"); +@@ -344,7 +344,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptNullViolation() { ++ void acceptNullViolation() { + final SuppressionCommentFilter filter = new SuppressionCommentFilter(); + final FileContents contents = + new FileContents( +@@ -358,7 +358,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptNullFileContents() { ++ void acceptNullFileContents() { + final SuppressionCommentFilter filter = new SuppressionCommentFilter(); + final FileContents contents = null; + final TreeWalkerAuditEvent auditEvent = +@@ -368,7 +368,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressByCheck() throws Exception { ++ void suppressByCheck() throws Exception { + final String[] suppressedViolation = { + "42:17: " + + getCheckMessage( +@@ -405,7 +405,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressById() throws Exception { ++ void suppressById() throws Exception { + final String[] suppressedViolation = { + "42:17: " + + getCheckMessage( +@@ -442,7 +442,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressByCheckAndId() throws Exception { ++ void suppressByCheckAndId() throws Exception { + final String[] suppressedViolation = { + "42:17: " + + getCheckMessage( +@@ -479,7 +479,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressByIdAndMessage() throws Exception { ++ void suppressByIdAndMessage() throws Exception { + final String[] suppressedViolation = { + "54:17: " + + getCheckMessage( +@@ -513,7 +513,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressByCheckAndMessage() throws Exception { ++ void suppressByCheckAndMessage() throws Exception { + final String[] suppressedViolation = { + "54:17: " + + getCheckMessage( +@@ -547,7 +547,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFindNearestMatchDontAllowSameColumn() { ++ void findNearestMatchDontAllowSameColumn() { + final SuppressionCommentFilter suppressionCommentFilter = new SuppressionCommentFilter(); + final FileContents contents = + new FileContents( +@@ -566,7 +566,7 @@ public class SuppressionCommentFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTagsAreClearedEachRun() { ++ void tagsAreClearedEachRun() { + final SuppressionCommentFilter suppressionCommentFilter = new SuppressionCommentFilter(); + final List tags1 = + getTagsAfterExecution(suppressionCommentFilter, "filename1", "//CHECKSTYLE:OFF", "line2"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java +index 3d5c86c1b..72319a873 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionFilterTest.java +@@ -36,7 +36,7 @@ import java.net.URL; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + +-public class SuppressionFilterTest extends AbstractModuleTestSupport { ++final class SuppressionFilterTest extends AbstractModuleTestSupport { + + @TempDir public File temporaryFolder; + +@@ -46,7 +46,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAccept() throws Exception { ++ void accept() throws Exception { + final String fileName = getPath("InputSuppressionFilterNone.xml"); + final boolean optional = false; + final SuppressionFilter filter = createSuppressionFilter(fileName, optional); +@@ -59,7 +59,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptFalse() throws Exception { ++ void acceptFalse() throws Exception { + final String fileName = getPath("InputSuppressionFilterSuppress.xml"); + final boolean optional = false; + final SuppressionFilter filter = createSuppressionFilter(fileName, optional); +@@ -74,7 +74,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptOnNullFile() throws CheckstyleException { ++ void acceptOnNullFile() throws CheckstyleException { + final String fileName = null; + final boolean optional = false; + final SuppressionFilter filter = createSuppressionFilter(fileName, optional); +@@ -86,7 +86,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonExistentSuppressionFileWithFalseOptional() { ++ void nonExistentSuppressionFileWithFalseOptional() { + final String fileName = "non_existent_suppression_file.xml"; + try { + final boolean optional = false; +@@ -100,7 +100,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExistingInvalidSuppressionFileWithTrueOptional() throws IOException { ++ void existingInvalidSuppressionFileWithTrueOptional() throws IOException { + final String fileName = getPath("InputSuppressionFilterInvalidFile.xml"); + try { + final boolean optional = true; +@@ -115,7 +115,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExistingSuppressionFileWithTrueOptional() throws Exception { ++ void existingSuppressionFileWithTrueOptional() throws Exception { + final String fileName = getPath("InputSuppressionFilterNone.xml"); + final boolean optional = true; + final SuppressionFilter filter = createSuppressionFilter(fileName, optional); +@@ -128,7 +128,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonExistentSuppressionFileWithTrueOptional() throws Exception { ++ void nonExistentSuppressionFileWithTrueOptional() throws Exception { + final String fileName = "non_existent_suppression_file.xml"; + final boolean optional = true; + final SuppressionFilter filter = createSuppressionFilter(fileName, optional); +@@ -141,7 +141,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonExistentSuppressionUrlWithTrueOptional() throws Exception { ++ void nonExistentSuppressionUrlWithTrueOptional() throws Exception { + final String fileName = "https://checkstyle.org/non_existent_suppression.xml"; + final boolean optional = true; + final SuppressionFilter filter = createSuppressionFilter(fileName, optional); +@@ -154,7 +154,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUseCacheLocalFileExternalResourceContentDoesNotChange() throws Exception { ++ void useCacheLocalFileExternalResourceContentDoesNotChange() throws Exception { + final DefaultConfiguration filterConfig = createModuleConfig(SuppressionFilter.class); + filterConfig.addProperty("file", getPath("InputSuppressionFilterNone.xml")); + +@@ -170,7 +170,7 @@ public class SuppressionFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUseCacheRemoteFileExternalResourceContentDoesNotChange() throws Exception { ++ void useCacheRemoteFileExternalResourceContentDoesNotChange() throws Exception { + final String[] urlCandidates = { + "https://checkstyle.org/files/suppressions_none.xml", + "https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/site/resources/" +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionSingleFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionSingleFilterTest.java +index b78f21665..1f0dd348c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionSingleFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionSingleFilterTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.checks.regexp.RegexpSinglelineCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { ++final class SuppressionSingleFilterTest extends AbstractModuleTestSupport { + + private static final String FORMAT = "TODO$"; + private static final String MESSAGE = +@@ -39,7 +39,7 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefault() throws Exception { ++ void testDefault() throws Exception { + final String[] suppressed = { + "25: " + MESSAGE, + }; +@@ -47,7 +47,7 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatching() throws Exception { ++ void matching() throws Exception { + final String[] suppressed = { + "25: " + MESSAGE, + }; +@@ -55,31 +55,31 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingLineNumber() throws Exception { ++ void nonMatchingLineNumber() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser(getPath("InputSuppressionSingleFilter4.java"), suppressed); + } + + @Test +- public void testNonMatchingColumnNumber() throws Exception { ++ void nonMatchingColumnNumber() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser(getPath("InputSuppressionSingleFilter5.java"), suppressed); + } + + @Test +- public void testNonMatchingFileRegexp() throws Exception { ++ void nonMatchingFileRegexp() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser(getPath("InputSuppressionSingleFilter6.java"), suppressed); + } + + @Test +- public void testNonMatchingModuleId() throws Exception { ++ void nonMatchingModuleId() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser(getPath("InputSuppressionSingleFilter7.java"), suppressed); + } + + @Test +- public void testMatchingModuleId() throws Exception { ++ void matchingModuleId() throws Exception { + final String[] suppressed = { + "25: " + MESSAGE, + }; +@@ -87,19 +87,19 @@ public class SuppressionSingleFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingChecks() throws Exception { ++ void nonMatchingChecks() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser(getPath("InputSuppressionSingleFilter8.java"), suppressed); + } + + @Test +- public void testNotMatchingMessage() throws Exception { ++ void notMatchingMessage() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifySuppressedWithParser(getPath("InputSuppressionSingleFilter9.java"), suppressed); + } + + @Test +- public void testMatchMessage() throws Exception { ++ void matchMessage() throws Exception { + final String[] suppressed = { + "25: " + MESSAGE, + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilterTest.java +index 7ec504535..7026a3b5d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathFilterTest.java +@@ -23,19 +23,19 @@ import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck.MSG_KEY; + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenTextCheck; + import com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +-import java.util.Collections; + import java.util.Set; + import nl.jqno.equalsverifier.EqualsVerifier; + import nl.jqno.equalsverifier.EqualsVerifierReport; + import nl.jqno.equalsverifier.Warning; + import org.junit.jupiter.api.Test; + +-public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { ++final class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + + private static final String PATTERN = "^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"; + +@@ -49,7 +49,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptOne() throws Exception { ++ void acceptOne() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifyFilterWithInlineConfigParser( + getPath("InputSuppressionXpathFilterAcceptOne.java"), +@@ -58,7 +58,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptTwo() throws Exception { ++ void acceptTwo() throws Exception { + final String[] expected = { + "20:29: " + + getCheckMessage( +@@ -75,7 +75,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAcceptOnNullFile() throws Exception { ++ void acceptOnNullFile() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifyFilterWithInlineConfigParser( + getPath("InputSuppressionXpathFilterAcceptOnNullFile.java"), +@@ -84,7 +84,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonExistentSuppressionFileWithFalseOptional() throws Exception { ++ void nonExistentSuppressionFileWithFalseOptional() throws Exception { + final String fileName = getPath("non_existent_suppression_file.xml"); + try { + final boolean optional = false; +@@ -98,7 +98,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExistingInvalidSuppressionFileWithTrueOptional() throws Exception { ++ void existingInvalidSuppressionFileWithTrueOptional() throws Exception { + final String fileName = getPath("InputSuppressionXpathFilterInvalidFile.xml"); + try { + final boolean optional = true; +@@ -115,7 +115,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExistingSuppressionFileWithTrueOptional() throws Exception { ++ void existingSuppressionFileWithTrueOptional() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifyFilterWithInlineConfigParser( + getPath("InputSuppressionXpathFilterAcceptWithOptionalTrue.java"), +@@ -124,7 +124,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonExistentSuppressionFileWithTrueOptional() throws Exception { ++ void nonExistentSuppressionFileWithTrueOptional() throws Exception { + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + verifyFilterWithInlineConfigParser( + getPath("InputSuppressionXpathFilterNonExistentFileWithTrueOptional.java"), +@@ -133,7 +133,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testReject() throws Exception { ++ void reject() throws Exception { + final String[] suppressed = { + "20:29: " + + getCheckMessage(ConstantNameCheck.class, MSG_INVALID_PATTERN, "bad_name", PATTERN), +@@ -145,7 +145,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsAndHashCode() { ++ void equalsAndHashCode() { + final EqualsVerifierReport ev = + EqualsVerifier.forClass(SuppressionXpathFilter.class) + .usingGetClass() +@@ -156,11 +156,11 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExternalResource() throws Exception { ++ void externalResource() throws Exception { + final boolean optional = false; + final String fileName = getPath("InputSuppressionXpathFilterIdAndQuery.xml"); + final SuppressionXpathFilter filter = createSuppressionXpathFilter(fileName, optional); +- final Set expected = Collections.singleton(fileName); ++ final Set expected = ImmutableSet.of(fileName); + final Set actual = filter.getExternalResourceLocations(); + assertWithMessage("Invalid external resource").that(actual).isEqualTo(expected); + } +@@ -175,7 +175,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFalseEncodeString() throws Exception { ++ void falseEncodeString() throws Exception { + final String pattern = "[^a-zA-z0-9]*"; + final String[] expected = { + "17:24: " + getCheckMessage(IllegalTokenTextCheck.class, MSG_KEY, pattern), +@@ -206,7 +206,7 @@ public class SuppressionXpathFilterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFalseEncodeChar() throws Exception { ++ void falseEncodeChar() throws Exception { + final String pattern = "[^a-zA-z0-9]*"; + final String[] expected = { + "17:14: " + getCheckMessage(IllegalTokenTextCheck.class, MSG_KEY, pattern), +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterTest.java +index 011b2d060..fb62f0718 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionXpathSingleFilterTest.java +@@ -39,7 +39,7 @@ import java.nio.charset.StandardCharsets; + import java.util.regex.PatternSyntaxException; + import org.junit.jupiter.api.Test; + +-public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport { ++final class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -47,7 +47,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testMatching() throws Exception { ++ void matching() throws Exception { + final String[] expected = { + "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -63,7 +63,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNonMatchingTokenType() throws Exception { ++ void nonMatchingTokenType() throws Exception { + final String[] expected = { + "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -77,7 +77,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNonMatchingLineNumber() throws Exception { ++ void nonMatchingLineNumber() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + "21:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), +@@ -94,7 +94,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNonMatchingColumnNumber() throws Exception { ++ void nonMatchingColumnNumber() throws Exception { + final String[] expected = { + "23:11: " + + getCheckMessage( +@@ -112,7 +112,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testComplexQuery() throws Exception { ++ void complexQuery() throws Exception { + final String[] expected = { + "27:21: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "3.14"), + "28:16: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "123"), +@@ -128,7 +128,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testIncorrectQuery() { ++ void incorrectQuery() { + final String xpath = "1@#"; + try { + final Object test = +@@ -143,7 +143,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNoQuery() throws Exception { ++ void noQuery() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -159,7 +159,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNullFileName() throws Exception { ++ void nullFileName() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -173,7 +173,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNonMatchingFileRegexp() throws Exception { ++ void nonMatchingFileRegexp() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -187,7 +187,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testInvalidFileRegexp() { ++ void invalidFileRegexp() { + final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); + try { + filter.setFiles("e[l"); +@@ -200,7 +200,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testInvalidCheckRegexp() { ++ void invalidCheckRegexp() { + final SuppressionXpathSingleFilter filter = new SuppressionXpathSingleFilter(); + try { + filter.setChecks("e[l"); +@@ -213,7 +213,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNullViolation() throws Exception { ++ void nullViolation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + final String[] suppressed = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -224,7 +224,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNonMatchingModuleId() throws Exception { ++ void nonMatchingModuleId() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -238,7 +238,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testMatchingModuleId() throws Exception { ++ void matchingModuleId() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -254,7 +254,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNonMatchingChecks() throws Exception { ++ void nonMatchingChecks() throws Exception { + final String[] expected = { + "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -268,7 +268,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNonMatchingFileNameModuleIdAndCheck() throws Exception { ++ void nonMatchingFileNameModuleIdAndCheck() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -281,7 +281,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testNullModuleIdAndNonMatchingChecks() throws Exception { ++ void nullModuleIdAndNonMatchingChecks() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -294,7 +294,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testDecideByMessage() throws Exception { ++ void decideByMessage() throws Exception { + final String[] expected = { + "28:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + "30:21: " + getCheckMessage(MagicNumberCheck.class, MSG_KEY, "3.14"), +@@ -313,7 +313,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testThrowException() throws Exception { ++ void throwException() throws Exception { + final String xpath = "//CLASS_DEF[@text='InputSuppressionXpathSingleFilterComplexQuery']"; + final SuppressionXpathSingleFilter filter = + createSuppressionXpathSingleFilter( +@@ -339,7 +339,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testAllNullConfiguration() throws Exception { ++ void allNullConfiguration() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -353,7 +353,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testDecideByIdAndExpression() throws Exception { ++ void decideByIdAndExpression() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -369,7 +369,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testDefaultFileProperty() throws Exception { ++ void defaultFileProperty() throws Exception { + final String[] expected = { + "20:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -385,7 +385,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testDecideByCheck() throws Exception { ++ void decideByCheck() throws Exception { + final String[] expected = { + "18:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +@@ -401,7 +401,7 @@ public class SuppressionXpathSingleFilterTest extends AbstractModuleTestSupport + } + + @Test +- public void testDecideById() throws Exception { ++ void decideById() throws Exception { + final String[] expected = { + "19:1: " + getCheckMessage(MissingJavadocTypeCheck.class, MSG_JAVADOC_MISSING), + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java +index 874dcad40..ee65e18a9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/SuppressionsLoaderTest.java +@@ -36,7 +36,7 @@ import org.junit.jupiter.api.Test; + import org.xml.sax.InputSource; + + /** Tests SuppressionsLoader. */ +-public class SuppressionsLoaderTest extends AbstractPathTestSupport { ++final class SuppressionsLoaderTest extends AbstractPathTestSupport { + + @Override + protected String getPackageLocation() { +@@ -44,7 +44,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testNoSuppressions() throws Exception { ++ void noSuppressions() throws Exception { + final FilterSet fc = + SuppressionsLoader.loadSuppressions(getPath("InputSuppressionsLoaderNone.xml")); + final FilterSet fc2 = new FilterSet(); +@@ -54,7 +54,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoadFromUrl() throws Exception { ++ void loadFromUrl() throws Exception { + final String[] urlCandidates = { + "https://raw.githubusercontent.com/checkstyle/checkstyle/master/src/site/resources/" + + "files/suppressions_none.xml", +@@ -78,7 +78,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoadFromMalformedUrl() { ++ void loadFromMalformedUrl() { + try { + SuppressionsLoader.loadSuppressions("http"); + assertWithMessage("exception expected").fail(); +@@ -90,7 +90,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoadFromNonExistentUrl() { ++ void loadFromNonExistentUrl() { + try { + SuppressionsLoader.loadSuppressions("http://^%$^* %&% %^&"); + assertWithMessage("exception expected").fail(); +@@ -102,7 +102,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testMultipleSuppression() throws Exception { ++ void multipleSuppression() throws Exception { + final FilterSet fc = + SuppressionsLoader.loadSuppressions(getPath("InputSuppressionsLoaderMultiple.xml")); + final FilterSet fc2 = new FilterSet(); +@@ -128,7 +128,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testNoFile() throws IOException { ++ void noFile() throws IOException { + final String fn = getPath("InputSuppressionsLoaderNoFile.xml"); + try { + SuppressionsLoader.loadSuppressions(fn); +@@ -148,7 +148,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testNoCheck() throws IOException { ++ void noCheck() throws IOException { + final String fn = getPath("InputSuppressionsLoaderNoCheck.xml"); + try { + SuppressionsLoader.loadSuppressions(fn); +@@ -168,7 +168,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testBadInt() throws IOException { ++ void badInt() throws IOException { + final String fn = getPath("InputSuppressionsLoaderBadInt.xml"); + try { + SuppressionsLoader.loadSuppressions(fn); +@@ -219,7 +219,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testUnableToFindSuppressions() { ++ void unableToFindSuppressions() { + final String sourceName = "InputSuppressionsLoaderNone.xml"; + + try { +@@ -236,7 +236,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testUnableToReadSuppressions() { ++ void unableToReadSuppressions() { + final String sourceName = "InputSuppressionsLoaderNone.xml"; + + try { +@@ -253,7 +253,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testNoCheckNoId() throws IOException { ++ void noCheckNoId() throws IOException { + final String fn = getPath("InputSuppressionsLoaderNoCheckAndId.xml"); + try { + SuppressionsLoader.loadSuppressions(fn); +@@ -266,7 +266,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testNoCheckYesId() throws Exception { ++ void noCheckYesId() throws Exception { + final String fn = getPath("InputSuppressionsLoaderId.xml"); + final FilterSet set = SuppressionsLoader.loadSuppressions(fn); + +@@ -274,7 +274,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testInvalidFileFormat() throws IOException { ++ void invalidFileFormat() throws IOException { + final String fn = getPath("InputSuppressionsLoaderInvalidFile.xml"); + try { + SuppressionsLoader.loadSuppressions(fn); +@@ -287,7 +287,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testLoadFromClasspath() throws Exception { ++ void loadFromClasspath() throws Exception { + final FilterSet fc = + SuppressionsLoader.loadSuppressions(getPath("InputSuppressionsLoaderNone.xml")); + final FilterSet fc2 = new FilterSet(); +@@ -297,7 +297,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testSettingModuleId() throws Exception { ++ void settingModuleId() throws Exception { + final FilterSet fc = + SuppressionsLoader.loadSuppressions(getPath("InputSuppressionsLoaderWithId.xml")); + final SuppressFilterElement suppressElement = +@@ -308,7 +308,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testXpathSuppressions() throws Exception { ++ void xpathSuppressions() throws Exception { + final String fn = getPath("InputSuppressionsLoaderXpathCorrect.xml"); + final Set filterSet = SuppressionsLoader.loadXpathSuppressions(fn); + +@@ -325,7 +325,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testXpathInvalidFileFormat() throws IOException { ++ void xpathInvalidFileFormat() throws IOException { + final String fn = getPath("InputSuppressionsLoaderXpathInvalidFile.xml"); + try { + SuppressionsLoader.loadXpathSuppressions(fn); +@@ -341,7 +341,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testXpathNoCheckNoId() throws IOException { ++ void xpathNoCheckNoId() throws IOException { + final String fn = getPath("InputSuppressionsLoaderXpathNoCheckAndId.xml"); + try { + SuppressionsLoader.loadXpathSuppressions(fn); +@@ -357,7 +357,7 @@ public class SuppressionsLoaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testXpathNoCheckYesId() throws Exception { ++ void xpathNoCheckYesId() throws Exception { + final String fn = getPath("InputSuppressionsLoaderXpathId.xml"); + final Set filterSet = SuppressionsLoader.loadXpathSuppressions(fn); + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElementTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElementTest.java +index 48e04922c..67923e402 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElementTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/filters/XpathFilterElementTest.java +@@ -39,13 +39,13 @@ import nl.jqno.equalsverifier.EqualsVerifierReport; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class XpathFilterElementTest extends AbstractModuleTestSupport { ++final class XpathFilterElementTest extends AbstractModuleTestSupport { + + private File file; + private FileContents fileContents; + + @BeforeEach +- public void setUp() throws Exception { ++ void setUp() throws Exception { + file = new File(getPath("InputXpathFilterElementSuppressByXpath.java")); + fileContents = new FileContents(new FileText(file, StandardCharsets.UTF_8.name())); + } +@@ -56,7 +56,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatching() throws Exception { ++ void matching() throws Exception { + final String xpath = "//CLASS_DEF[./IDENT[@text='InputXpathFilterElementSuppressByXpath']]"; + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); +@@ -65,7 +65,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingTokenType() throws Exception { ++ void nonMatchingTokenType() throws Exception { + final String xpath = "//METHOD_DEF[./IDENT[@text='countTokens']]"; + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); +@@ -74,7 +74,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingLineNumber() throws Exception { ++ void nonMatchingLineNumber() throws Exception { + final String xpath = "//CLASS_DEF[./IDENT[@text='InputXpathFilterElementSuppressByXpath']]"; + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); +@@ -83,7 +83,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingColumnNumber() throws Exception { ++ void nonMatchingColumnNumber() throws Exception { + final String xpath = "//CLASS_DEF[./IDENT[@text='InputXpathFilterElementSuppressByXpath']]"; + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); +@@ -92,7 +92,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testComplexQuery() throws Exception { ++ void complexQuery() throws Exception { + final String xpath = + "//VARIABLE_DEF[./IDENT[@text='pi'] and " + + "../../IDENT[@text='countTokens']] " +@@ -108,7 +108,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testInvalidCheckRegexp() { ++ void invalidCheckRegexp() { + try { + final Object test = new XpathFilterElement(".*", "e[l", ".*", "moduleId", "query"); + assertWithMessage("Exception is expected but got " + test).fail(); +@@ -120,7 +120,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIncorrectQuery() { ++ void incorrectQuery() { + final String xpath = "1@#"; + try { + final Object test = +@@ -135,7 +135,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoQuery() throws Exception { ++ void noQuery() throws Exception { + final TreeWalkerAuditEvent event = getEvent(15, 8, TokenTypes.VARIABLE_DEF); + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, null); +@@ -143,7 +143,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullFileName() { ++ void nullFileName() { + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, null); + final TreeWalkerAuditEvent ev = new TreeWalkerAuditEvent(null, null, null, null); +@@ -151,7 +151,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingFileRegexp() throws Exception { ++ void nonMatchingFileRegexp() throws Exception { + final XpathFilterElement filter = + new XpathFilterElement("NonMatchingRegexp", "Test", null, null, null); + final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); +@@ -159,7 +159,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingFilePattern() throws Exception { ++ void nonMatchingFilePattern() throws Exception { + final Pattern pattern = Pattern.compile("NonMatchingRegexp"); + final XpathFilterElement filter = new XpathFilterElement(pattern, null, null, null, null); + final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); +@@ -167,7 +167,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingCheckRegexp() throws Exception { ++ void nonMatchingCheckRegexp() throws Exception { + final XpathFilterElement filter = + new XpathFilterElement(null, "NonMatchingRegexp", null, null, null); + final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); +@@ -175,7 +175,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingCheckPattern() throws Exception { ++ void nonMatchingCheckPattern() throws Exception { + final Pattern pattern = Pattern.compile("NonMatchingRegexp"); + final XpathFilterElement filter = new XpathFilterElement(null, pattern, null, null, null); + final TreeWalkerAuditEvent ev = getEvent(3, 0, TokenTypes.CLASS_DEF); +@@ -183,7 +183,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullViolation() { ++ void nullViolation() { + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, null); + final TreeWalkerAuditEvent ev = new TreeWalkerAuditEvent(null, file.getName(), null, null); +@@ -191,7 +191,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingModuleId() throws Exception { ++ void nonMatchingModuleId() throws Exception { + final XpathFilterElement filter = + new XpathFilterElement( + "InputXpathFilterElementSuppressByXpath", "Test", null, "id19", null); +@@ -207,7 +207,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMatchingModuleId() throws Exception { ++ void matchingModuleId() throws Exception { + final String xpath = "//CLASS_DEF[./IDENT[@text='InputXpathFilterElementSuppressByXpath']]"; + final XpathFilterElement filter = + new XpathFilterElement( +@@ -224,7 +224,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingChecks() throws Exception { ++ void nonMatchingChecks() throws Exception { + final String xpath = "NON_MATCHING_QUERY"; + final XpathFilterElement filter = + new XpathFilterElement( +@@ -241,7 +241,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNonMatchingFileNameModuleIdAndCheck() throws Exception { ++ void nonMatchingFileNameModuleIdAndCheck() throws Exception { + final String xpath = "NON_MATCHING_QUERY"; + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", null, null, null, xpath); +@@ -250,7 +250,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNullModuleIdAndNonMatchingChecks() throws Exception { ++ void nullModuleIdAndNonMatchingChecks() throws Exception { + final String xpath = "NON_MATCHING_QUERY"; + final XpathFilterElement filter = + new XpathFilterElement( +@@ -260,7 +260,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDecideByMessage() throws Exception { ++ void decideByMessage() throws Exception { + final Violation message = + new Violation(1, 0, TokenTypes.CLASS_DEF, "", "", null, null, null, getClass(), "Test"); + final TreeWalkerAuditEvent ev = +@@ -276,7 +276,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThrowException() { ++ void throwException() { + final String xpath = "//CLASS_DEF[@text='InputXpathFilterElementSuppressByXpath']"; + final XpathFilterElement filter = + new XpathFilterElement("InputXpathFilterElementSuppressByXpath", "Test", null, null, xpath); +@@ -295,7 +295,7 @@ public class XpathFilterElementTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEqualsAndHashCode() throws Exception { ++ void equalsAndHashCode() throws Exception { + final XPathEvaluator xpathEvaluator = new XPathEvaluator(Configuration.newConfiguration()); + final EqualsVerifierReport ev = + EqualsVerifier.forClass(XpathFilterElement.class) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/AstRegressionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/AstRegressionTest.java +index 806a4e9e8..210a3c967 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/AstRegressionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/AstRegressionTest.java +@@ -30,7 +30,7 @@ import java.nio.charset.StandardCharsets; + import java.util.Arrays; + import org.junit.jupiter.api.Test; + +-public class AstRegressionTest extends AbstractTreeTestSupport { ++final class AstRegressionTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -38,115 +38,115 @@ public class AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testClassAstTree1() throws Exception { ++ void classAstTree1() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaClass1Ast.txt"), getPath("InputRegressionJavaClass1.java")); + } + + @Test +- public void testClassAstTree2() throws Exception { ++ void classAstTree2() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaClass2Ast.txt"), getPath("InputRegressionJavaClass2.java")); + } + + @Test +- public void testJava8ClassAstTree1() throws Exception { ++ void java8ClassAstTree1() throws Exception { + verifyAst( + getPath("ExpectedRegressionJava8Class1Ast.txt"), + getPath("InputRegressionJava8Class1.java")); + } + + @Test +- public void testJava8ClassAstTree2() throws Exception { ++ void java8ClassAstTree2() throws Exception { + verifyAst( + getPath("ExpectedRegressionJava8Class2Ast.txt"), + getPath("InputRegressionJava8Class2.java")); + } + + @Test +- public void testJava9TryWithResourcesAstTree() throws Exception { ++ void java9TryWithResourcesAstTree() throws Exception { + verifyAst( + getPath("ExpectedJava9TryWithResources.txt"), + getPath("/java9/InputJava9TryWithResources.java")); + } + + @Test +- public void testAdvanceJava9TryWithResourcesAstTree() throws Exception { ++ void advanceJava9TryWithResourcesAstTree() throws Exception { + verifyAst( + getPath("ExpectedAdvanceJava9TryWithResources.txt"), + getPath("/java9/InputAdvanceJava9TryWithResources.java")); + } + + @Test +- public void testInputSemicolonBetweenImports() throws Exception { ++ void inputSemicolonBetweenImports() throws Exception { + verifyAst( + getPath("ExpectedSemicolonBetweenImportsAst.txt"), + getNonCompilablePath("InputSemicolonBetweenImports.java")); + } + + @Test +- public void testInterfaceAstTree1() throws Exception { ++ void interfaceAstTree1() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaInterface1Ast.txt"), + getPath("InputRegressionJavaInterface1.java")); + } + + @Test +- public void testInterfaceAstTree2() throws Exception { ++ void interfaceAstTree2() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaInterface2Ast.txt"), + getPath("InputRegressionJavaInterface2.java")); + } + + @Test +- public void testJava8InterfaceAstTree1() throws Exception { ++ void java8InterfaceAstTree1() throws Exception { + verifyAst( + getPath("ExpectedRegressionJava8Interface1Ast.txt"), + getPath("InputRegressionJava8Interface1.java")); + } + + @Test +- public void testEnumAstTree1() throws Exception { ++ void enumAstTree1() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaEnum1Ast.txt"), getPath("InputRegressionJavaEnum1.java")); + } + + @Test +- public void testEnumAstTree2() throws Exception { ++ void enumAstTree2() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaEnum2Ast.txt"), getPath("InputRegressionJavaEnum2.java")); + } + + @Test +- public void testAnnotationAstTree1() throws Exception { ++ void annotationAstTree1() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaAnnotation1Ast.txt"), + getPath("InputRegressionJavaAnnotation1.java")); + } + + @Test +- public void testTypecast() throws Exception { ++ void typecast() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaTypecastAst.txt"), + getPath("InputRegressionJavaTypecast.java")); + } + + @Test +- public void testJava14InstanceofWithPatternMatching() throws Exception { ++ void java14InstanceofWithPatternMatching() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14InstanceofWithPatternMatchingAST.txt"), + getNonCompilablePath("java14/InputJava14InstanceofWithPatternMatching.java")); + } + + @Test +- public void testCharLiteralSurrogatePair() throws Exception { ++ void charLiteralSurrogatePair() throws Exception { + verifyAst( + getPath("ExpectedCharLiteralSurrogatePair.txt"), + getPath("InputCharLiteralSurrogatePair.java")); + } + + @Test +- public void testCustomAstTree() throws Exception { ++ void customAstTree() throws Exception { + verifyAstRaw(getPath("ExpectedRegressionEmptyAst.txt"), "\t"); + verifyAstRaw(getPath("ExpectedRegressionEmptyAst.txt"), "\r\n"); + verifyAstRaw(getPath("ExpectedRegressionEmptyAst.txt"), "\n"); +@@ -170,7 +170,7 @@ public class AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testNewlineCr() throws Exception { ++ void newlineCr() throws Exception { + verifyAst( + getPath("ExpectedNewlineCrAtEndOfFileAst.txt"), + getPath("InputAstRegressionNewlineCrAtEndOfFile.java"), +@@ -178,105 +178,105 @@ public class AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testJava14Records() throws Exception { ++ void java14Records() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14Records.txt"), + getNonCompilablePath("java14/InputJava14Records.java")); + } + + @Test +- public void testJava14RecordsTopLevel() throws Exception { ++ void java14RecordsTopLevel() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14RecordsTopLevel.txt"), + getNonCompilablePath("java14/InputJava14RecordsTopLevel.java")); + } + + @Test +- public void testJava14LocalRecordAnnotation() throws Exception { ++ void java14LocalRecordAnnotation() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14LocalRecordAnnotation.txt"), + getNonCompilablePath("java14/InputJava14LocalRecordAnnotation.java")); + } + + @Test +- public void testJava14TextBlocks() throws Exception { ++ void java14TextBlocks() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14TextBlocks.txt"), + getNonCompilablePath("java14/InputJava14TextBlocks.java")); + } + + @Test +- public void testJava14TextBlocksEscapes() throws Exception { ++ void java14TextBlocksEscapes() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14TextBlocksEscapesAreOneChar.txt"), + getNonCompilablePath("java14/InputJava14TextBlocksEscapesAreOneChar.java")); + } + + @Test +- public void testJava14SwitchExpression() throws Exception { ++ void java14SwitchExpression() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14SwitchExpression.txt"), + getNonCompilablePath("java14/InputJava14SwitchExpression.java")); + } + + @Test +- public void testInputJava14TextBlocksTabSize() throws Exception { ++ void inputJava14TextBlocksTabSize() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14TextBlocksTabSize.txt"), + getNonCompilablePath("java14/InputJava14TextBlocksTabSize.java")); + } + + @Test +- public void testInputEscapedS() throws Exception { ++ void inputEscapedS() throws Exception { + verifyAst( + getPath("java14/ExpectedJava14EscapedS.txt"), + getNonCompilablePath("java14/InputJava14EscapedS.java")); + } + + @Test +- public void testInputSealedAndPermits() throws Exception { ++ void inputSealedAndPermits() throws Exception { + verifyAst( + getPath("java15/ExpectedAstRegressionSealedAndPermits.txt"), + getNonCompilablePath("java15/InputAstRegressionSealedAndPermits.java")); + } + + @Test +- public void testInputTopLevelNonSealed() throws Exception { ++ void inputTopLevelNonSealed() throws Exception { + verifyAst( + getPath("java15/ExpectedTopLevelNonSealed.txt"), + getNonCompilablePath("java15/InputTopLevelNonSealed.java")); + } + + @Test +- public void testPatternVariableWithModifiers() throws Exception { ++ void patternVariableWithModifiers() throws Exception { + verifyAst( + getPath("java16/ExpectedPatternVariableWithModifiers.txt"), + getNonCompilablePath("java16/InputPatternVariableWithModifiers.java")); + } + + @Test +- public void testInputMethodDefArrayDeclarator() throws Exception { ++ void inputMethodDefArrayDeclarator() throws Exception { + verifyAst( + getPath("ExpectedAstRegressionMethodDefArrayDeclarator.txt"), + getPath("InputAstRegressionMethodDefArrayDeclarator.java")); + } + + @Test +- public void testInputCstyleArrayDefinition() throws Exception { ++ void inputCstyleArrayDefinition() throws Exception { + verifyAst( + getPath("ExpectedAstRegressionCStyleArrayDefinition.txt"), + getPath("InputAstRegressionCStyleArrayDefinition.java")); + } + + @Test +- public void testInputAnnotatedMethodVariableArityParam() throws Exception { ++ void inputAnnotatedMethodVariableArityParam() throws Exception { + verifyAst( + getPath("ExpectedAstRegressionAnnotatedMethodVariableArityParam.txt"), + getPath("InputAstRegressionAnnotatedMethodVariableArityParam.java")); + } + + @Test +- public void testInputManyAlternativesInMultiCatch() throws Exception { ++ void inputManyAlternativesInMultiCatch() throws Exception { + verifyAst( + getPath("ExpectedAstRegressionManyAlternativesInMultiCatch.txt"), + getPath("InputAstRegressionManyAlternativesInMultiCatch.java")); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/CrAwareLexerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/CrAwareLexerTest.java +index 3884393f6..e9b6e0005 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/CrAwareLexerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/CrAwareLexerTest.java +@@ -25,10 +25,10 @@ import org.antlr.v4.runtime.CharStream; + import org.antlr.v4.runtime.CharStreams; + import org.junit.jupiter.api.Test; + +-public class CrAwareLexerTest { ++final class CrAwareLexerTest { + + @Test +- public void testConsumeCarriageReturnZeroCharPositionInLine() { ++ void consumeCarriageReturnZeroCharPositionInLine() { + final String text = "\r"; + final CharStream charStream = CharStreams.fromString(text); + final CrAwareLexerSimulator lexer = new CrAwareLexerSimulator(null, null, null, null); +@@ -40,7 +40,7 @@ public class CrAwareLexerTest { + } + + @Test +- public void testConsumeCarriageReturnNewline() { ++ void consumeCarriageReturnNewline() { + final String text = "\r"; + final CharStream charStream = CharStreams.fromString(text); + final CrAwareLexerSimulator lexer = new CrAwareLexerSimulator(null, null, null, null); +@@ -52,7 +52,7 @@ public class CrAwareLexerTest { + } + + @Test +- public void testConsumeWindowsNewlineZeroCharPositionInLine() { ++ void consumeWindowsNewlineZeroCharPositionInLine() { + final String text = "\r\n"; + final CharStream charStream = CharStreams.fromString(text); + final CrAwareLexerSimulator lexer = new CrAwareLexerSimulator(null, null, null, null); +@@ -65,7 +65,7 @@ public class CrAwareLexerTest { + } + + @Test +- public void testConsumeWindowsNewline() { ++ void consumeWindowsNewline() { + final String text = "\r\n"; + final CharStream charStream = CharStreams.fromString(text); + final CrAwareLexerSimulator lexer = new CrAwareLexerSimulator(null, null, null, null); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/EmbeddedNullCharTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/EmbeddedNullCharTest.java +index b0cbe92ff..bf000e219 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/EmbeddedNullCharTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/EmbeddedNullCharTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests that embedded nulls in string literals does not halt parsing. */ +-public class EmbeddedNullCharTest extends AbstractModuleTestSupport { ++final class EmbeddedNullCharTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class EmbeddedNullCharTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputEmbeddedNullChar.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJava14LexerTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJava14LexerTest.java +index 4444992ab..83db88593 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJava14LexerTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJava14LexerTest.java +@@ -20,21 +20,21 @@ + package com.puppycrawl.tools.checkstyle.grammar; + + import static com.puppycrawl.tools.checkstyle.checks.naming.AbstractNameCheck.MSG_INVALID_PATTERN; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import java.nio.charset.Charset; +-import java.nio.charset.StandardCharsets; + import org.junit.jupiter.api.Assumptions; + import org.junit.jupiter.api.Test; + + /** Tests GeneratedJava14Lexer. */ +-public class GeneratedJava14LexerTest extends AbstractModuleTestSupport { ++final class GeneratedJava14LexerTest extends AbstractModuleTestSupport { + + /** Is {@code true} if current default encoding is UTF-8. */ + private static final boolean IS_UTF8 = +- Charset.forName(System.getProperty("file.encoding")).equals(StandardCharsets.UTF_8); ++ Charset.forName(System.getProperty("file.encoding")).equals(UTF_8); + + @Override + protected String getPackageLocation() { +@@ -42,7 +42,7 @@ public class GeneratedJava14LexerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testUnexpectedChar() throws Exception { ++ void unexpectedChar() throws Exception { + // Encoding problems will occur if default encoding is not UTF-8 + Assumptions.assumeTrue(IS_UTF8, "Problems with encoding may occur"); + +@@ -59,7 +59,7 @@ public class GeneratedJava14LexerTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSemicolonBetweenImports() throws Exception { ++ void semicolonBetweenImports() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser( + getNonCompilablePath("InputSemicolonBetweenImports.java"), expected); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJavaTokenTypesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJavaTokenTypesTest.java +index 2640a56b2..3c9177af4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJavaTokenTypesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/GeneratedJavaTokenTypesTest.java +@@ -19,16 +19,16 @@ + + package com.puppycrawl.tools.checkstyle.grammar; + ++import static com.google.common.collect.ImmutableList.toImmutableList; + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.Collections.lastIndexOfSubList; + + import com.puppycrawl.tools.checkstyle.grammar.java.JavaLanguageLexer; + import java.lang.reflect.Field; + import java.lang.reflect.Modifier; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import java.util.Objects; +-import java.util.stream.Collectors; + import org.antlr.v4.runtime.VocabularyImpl; + import org.junit.jupiter.api.Test; + +@@ -39,7 +39,7 @@ import org.junit.jupiter.api.Test; + * @noinspectionreason ClassIndependentOfModule - architecture of test modules requires this + * structure + */ +-public class GeneratedJavaTokenTypesTest { ++final class GeneratedJavaTokenTypesTest { + + /** + * New tokens must be added onto the end of the list with new numbers, and old tokens must remain +@@ -52,7 +52,7 @@ public class GeneratedJavaTokenTypesTest { + *

Issue: #505 + */ + @Test +- public void testTokenNumbering() { ++ void tokenNumbering() { + final String message = + "A token's number has changed. Please open" + + " 'GeneratedJavaTokenTypesTest' and confirm which token is at fault.\n" +@@ -296,11 +296,11 @@ public class GeneratedJavaTokenTypesTest { + * unused tokens and cause Collections#lastIndexOfSubList to return a -1 and fail the test. + */ + @Test +- public void testTokenHasBeenAddedToTokensBlockInLexerGrammar() { ++ void tokenHasBeenAddedToTokensBlockInLexerGrammar() { + final VocabularyImpl vocabulary = (VocabularyImpl) JavaLanguageLexer.VOCABULARY; + final String[] nullableSymbolicNames = vocabulary.getSymbolicNames(); + final List allTokenNames = +- Arrays.stream(nullableSymbolicNames).filter(Objects::nonNull).collect(Collectors.toList()); ++ Arrays.stream(nullableSymbolicNames).filter(Objects::nonNull).collect(toImmutableList()); + + // Since the following tokens are not declared in the 'tokens' block, + // they will always appear last in the list of symbolic names provided +@@ -324,7 +324,7 @@ public class GeneratedJavaTokenTypesTest { + + // Get the starting index of the sublist of tokens, or -1 if sublist + // is not present. +- final int lastIndexOfSublist = Collections.lastIndexOfSubList(allTokenNames, unusedTokenNames); ++ final int lastIndexOfSublist = lastIndexOfSubList(allTokenNames, unusedTokenNames); + final int expectedNumberOfUsedTokens = allTokenNames.size() - unusedTokenNames.size(); + final String message = + "New tokens must be added to the 'tokens' block in the" + " lexer grammar."; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/HexFloatsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/HexFloatsTest.java +index e1b61c62e..7c05e1b4f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/HexFloatsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/HexFloatsTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests hex floats and doubles can be parsed. */ +-public class HexFloatsTest extends AbstractModuleTestSupport { ++final class HexFloatsTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class HexFloatsTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputHexFloat.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java14RecordsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java14RecordsTest.java +index 19cb97759..eb987bd82 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java14RecordsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java14RecordsTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class Java14RecordsTest extends AbstractModuleTestSupport { ++final class Java14RecordsTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class Java14RecordsTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJava14Records() throws Exception { ++ void java14Records() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getNonCompilablePath("InputJava14Records.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7DiamondTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7DiamondTest.java +index d7f917e99..d7919856c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7DiamondTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7DiamondTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests Java 7 diamond can be parsed. */ +-public class Java7DiamondTest extends AbstractModuleTestSupport { ++final class Java7DiamondTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class Java7DiamondTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJava7Diamond.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7MultiCatchTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7MultiCatchTest.java +index 8b5540ec9..cba363fe3 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7MultiCatchTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7MultiCatchTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests Java 7 multi-catch can be parsed. */ +-public class Java7MultiCatchTest extends AbstractModuleTestSupport { ++final class Java7MultiCatchTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class Java7MultiCatchTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJava7MultiCatch.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7NumericalLiteralsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7NumericalLiteralsTest.java +index 2fcde8de4..fbdfea530 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7NumericalLiteralsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7NumericalLiteralsTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests Java 7 numerical literals can be parsed. */ +-public class Java7NumericalLiteralsTest extends AbstractModuleTestSupport { ++final class Java7NumericalLiteralsTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class Java7NumericalLiteralsTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJava7NumericalLiterals.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7StringSwitchTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7StringSwitchTest.java +index a11ad3734..c85706772 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7StringSwitchTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7StringSwitchTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests Java 7 String in switch can be parsed. */ +-public class Java7StringSwitchTest extends AbstractModuleTestSupport { ++final class Java7StringSwitchTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class Java7StringSwitchTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJava7StringSwitch.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7TryWithResourcesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7TryWithResourcesTest.java +index 596b3cf7d..99ae10d8e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7TryWithResourcesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java7TryWithResourcesTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests Java 7 try-with-resources can be parsed. */ +-public class Java7TryWithResourcesTest extends AbstractModuleTestSupport { ++final class Java7TryWithResourcesTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class Java7TryWithResourcesTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJava7TryWithResources.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java9TryWithResourcesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java9TryWithResourcesTest.java +index 2f6d67706..d9f39761c 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java9TryWithResourcesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/Java9TryWithResourcesTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests Java 9 try-with-resources can be parsed. */ +-public class Java9TryWithResourcesTest extends AbstractModuleTestSupport { ++final class Java9TryWithResourcesTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class Java9TryWithResourcesTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputJava9TryWithResources.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/LineCommentAtTheEndOfFileTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/LineCommentAtTheEndOfFileTest.java +index c3946edc8..253449c69 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/LineCommentAtTheEndOfFileTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/LineCommentAtTheEndOfFileTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Checks that file can be parsed, when it ends on line-comment but without new-line. */ +-public class LineCommentAtTheEndOfFileTest extends AbstractModuleTestSupport { ++final class LineCommentAtTheEndOfFileTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class LineCommentAtTheEndOfFileTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLineCommentAtTheEndOfFile.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/MultiDimensionalArraysInGenericsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/MultiDimensionalArraysInGenericsTest.java +index 20a0551e4..6e867cbd0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/MultiDimensionalArraysInGenericsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/MultiDimensionalArraysInGenericsTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MultiDimensionalArraysInGenericsTest extends AbstractModuleTestSupport { ++final class MultiDimensionalArraysInGenericsTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class MultiDimensionalArraysInGenericsTest extends AbstractModuleTestSupp + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMultiDimensionalArraysInGenerics.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/UnicodeEscapeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/UnicodeEscapeTest.java +index d8fbc3d36..3d49c3d3f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/UnicodeEscapeTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/UnicodeEscapeTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests that extended unicode escapes can be parsed. */ +-public class UnicodeEscapeTest extends AbstractModuleTestSupport { ++final class UnicodeEscapeTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class UnicodeEscapeTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputUnicodeEscape.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/VarargTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/VarargTest.java +index 629fda3fc..9d8bae78e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/VarargTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/VarargTest.java +@@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + + /** Tests varargs can be parsed. */ +-public class VarargTest extends AbstractModuleTestSupport { ++final class VarargTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -32,7 +32,7 @@ public class VarargTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputVararg.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Antlr4AstRegressionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Antlr4AstRegressionTest.java +index d78124714..a996f087f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Antlr4AstRegressionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Antlr4AstRegressionTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; + import com.puppycrawl.tools.checkstyle.JavaParser; + import org.junit.jupiter.api.Test; + +-public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { ++final class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,229 +31,229 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testPackage() throws Exception { ++ void testPackage() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionPackage.txt"), + getPath("InputAntlr4AstRegressionPackage.java")); + } + + @Test +- public void testSimple() throws Exception { ++ void simple() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionSimple.txt"), + getPath("InputAntlr4AstRegressionSimple.java")); + } + + @Test +- public void testAnno() throws Exception { ++ void anno() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionSimpleWithAnno.txt"), + getPath("InputAntlr4AstRegressionSimpleWithAnno.java")); + } + + @Test +- public void testImports() throws Exception { ++ void imports() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionImports.txt"), + getPath("InputAntlr4AstRegressionImports.java")); + } + + @Test +- public void testConstructorCall() throws Exception { ++ void constructorCall() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionConstructorCall.txt"), + getPath("InputAntlr4AstRegressionConstructorCall.java")); + } + + @Test +- public void testMethodCall() throws Exception { ++ void methodCall() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionMethodCall.txt"), + getPath("InputAntlr4AstRegressionMethodCall.java")); + } + + @Test +- public void testRegressionJavaClass1() throws Exception { ++ void regressionJavaClass1() throws Exception { + verifyAst( + getPath("ExpectedRegressionJavaClass1Ast.txt"), getPath("InputRegressionJavaClass1.java")); + } + + @Test +- public void testRegressionAnnotationLocation() throws Exception { ++ void regressionAnnotationLocation() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionAnnotationLocation.txt"), + getPath("InputAntlr4AstRegressionAnnotationLocation.java")); + } + + @Test +- public void testRegressionKeywordsAndOperators() throws Exception { ++ void regressionKeywordsAndOperators() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionKeywordsAndOperators.txt"), + getPath("InputAntlr4AstRegressionKeywordsAndOperators.java")); + } + + @Test +- public void testRegressionDiamondOperators() throws Exception { ++ void regressionDiamondOperators() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionKeywordsAndOperators.txt"), + getPath("InputAntlr4AstRegressionKeywordsAndOperators.java")); + } + + @Test +- public void testSingleLineBlocks() throws Exception { ++ void singleLineBlocks() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionSingleLineBlocks.txt"), + getPath("InputAntlr4AstRegressionSingleLineBlocks.java")); + } + + @Test +- public void testExpressionList() throws Exception { ++ void expressionList() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionExpressionList.txt"), + getPath("InputAntlr4AstRegressionExpressionList.java")); + } + + @Test +- public void testNewTypeTree() throws Exception { ++ void newTypeTree() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionNewTypeTree.txt"), + getPath("InputAntlr4AstRegressionNewTypeTree.java")); + } + + @Test +- public void testFallThroughDefault() throws Exception { ++ void fallThroughDefault() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionFallThroughDefault.txt"), + getPath("InputAntlr4AstRegressionFallThroughDefault.java")); + } + + @Test +- public void testPackageAnnotation() throws Exception { ++ void packageAnnotation() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionPackageAnnotation.txt"), getPath("package-info.java")); + } + + @Test +- public void testAnnotationOnSameLine1() throws Exception { ++ void annotationOnSameLine1() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionAnnotationOnSameLine.txt"), + getPath("InputAntlr4AstRegressionAnnotationOnSameLine.java")); + } + + @Test +- public void testAnnotationOnSameLine2() throws Exception { ++ void annotationOnSameLine2() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionAnnotationOnSameLine2.txt"), + getPath("InputAntlr4AstRegressionAnnotationOnSameLine2.java")); + } + + @Test +- public void testSuppressWarnings() throws Exception { ++ void suppressWarnings() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionSuppressWarnings.txt"), + getPath("InputAntlr4AstRegressionSuppressWarnings.java")); + } + + @Test +- public void testBadOverride() throws Exception { ++ void badOverride() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionBadOverride.txt"), + getPath("InputAntlr4AstRegressionBadOverride.java")); + } + + @Test +- public void testTrickySwitch() throws Exception { ++ void trickySwitch() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionTrickySwitch.txt"), + getPath("InputAntlr4AstRegressionTrickySwitch.java")); + } + + @Test +- public void testExplicitInitialization() throws Exception { ++ void explicitInitialization() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionExplicitInitialization.txt"), + getPath("InputAntlr4AstRegressionExplicitInitialization.java")); + } + + @Test +- public void testTypeParams() throws Exception { ++ void typeParams() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionTypeParams.txt"), + getPath("InputAntlr4AstRegressionTypeParams.java")); + } + + @Test +- public void testForLoops() throws Exception { ++ void forLoops() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionForLoops.txt"), + getPath("InputAntlr4AstRegressionForLoops.java")); + } + + @Test +- public void testIllegalCatch() throws Exception { ++ void illegalCatch() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionIllegalCatch.txt"), + getPath("InputAntlr4AstRegressionIllegalCatch.java")); + } + + @Test +- public void testNestedTypeParametersAndArrayDeclarators() throws Exception { ++ void nestedTypeParametersAndArrayDeclarators() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionNestedTypeParametersAndArrayDeclarators.txt"), + getPath("InputAntlr4AstRegressionNestedTypeParametersAndArrayDeclarators.java")); + } + + @Test +- public void testNewLineAtEndOfFileCr() throws Exception { ++ void newLineAtEndOfFileCr() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionNewLineAtEndOfFileCr.txt"), + getPath("InputAntlr4AstRegressionNewLineAtEndOfFileCr.java")); + } + + @Test +- public void testWeirdCtor() throws Exception { ++ void weirdCtor() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionWeirdCtor.txt"), + getPath("InputAntlr4AstRegressionWeirdCtor.java")); + } + + @Test +- public void testAnnotationOnQualifiedTypes() throws Exception { ++ void annotationOnQualifiedTypes() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionAnnotationOnQualifiedTypes.txt"), + getPath("InputAntlr4AstRegressionAnnotationOnQualifiedTypes.java")); + } + + @Test +- public void testAnnotationOnArrays() throws Exception { ++ void annotationOnArrays() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionAnnotationOnArrays.txt"), + getPath("InputAntlr4AstRegressionAnnotationOnArrays.java")); + } + + @Test +- public void testMethodRefs() throws Exception { ++ void methodRefs() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionMethodRefs.txt"), + getPath("InputAntlr4AstRegressionMethodRefs.java")); + } + + @Test +- public void testEmbeddedBlockComments() throws Exception { ++ void embeddedBlockComments() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionEmbeddedBlockComments.txt"), + getPath("InputAntlr4AstRegressionEmbeddedBlockComments.java")); + } + + @Test +- public void testJava16LocalEnumAndInterface() throws Exception { ++ void java16LocalEnumAndInterface() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionJava16LocalEnumAndInterface.txt"), + getNonCompilablePath("InputAntlr4AstRegressionJava16LocalEnumAndInterface.java")); + } + + @Test +- public void testTrickySwitchWithComments() throws Exception { ++ void trickySwitchWithComments() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionTrickySwitchWithComments.txt"), + getPath("InputAntlr4AstRegressionTrickySwitchWithComments.java"), +@@ -261,7 +261,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testCassandraInputWithComments() throws Exception { ++ void cassandraInputWithComments() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionCassandraInputWithComments.txt"), + getPath("InputAntlr4AstRegressionCassandraInputWithComments.java"), +@@ -269,7 +269,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testCommentsOnAnnotationsAndEnums() throws Exception { ++ void commentsOnAnnotationsAndEnums() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionCommentsOnAnnotationsAndEnums.txt"), + getPath("InputAntlr4AstRegressionCommentsOnAnnotationsAndEnums.java"), +@@ -277,7 +277,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testUncommon() throws Exception { ++ void uncommon() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionUncommon.txt"), + getNonCompilablePath("InputAntlr4AstRegressionUncommon.java"), +@@ -285,7 +285,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testUncommon2() throws Exception { ++ void uncommon2() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionUncommon2.txt"), + getNonCompilablePath("InputAntlr4AstRegressionUncommon2.java"), +@@ -293,7 +293,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testTrickyYield() throws Exception { ++ void trickyYield() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionTrickyYield.txt"), + getPath("InputAntlr4AstRegressionTrickyYield.java"), +@@ -301,7 +301,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testSingleCommaInArrayInit() throws Exception { ++ void singleCommaInArrayInit() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionSingleCommaInArrayInit.txt"), + getPath("InputAntlr4AstRegressionSingleCommaInArrayInit.java"), +@@ -309,7 +309,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testUncommon3() throws Exception { ++ void uncommon3() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionUncommon3.txt"), + getNonCompilablePath("InputAntlr4AstRegressionUncommon3.java"), +@@ -317,7 +317,7 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testUncommon4() throws Exception { ++ void uncommon4() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionUncommon4.txt"), + getPath("InputAntlr4AstRegressionUncommon4.java"), +@@ -325,14 +325,14 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testQualifiedConstructorParameter() throws Exception { ++ void qualifiedConstructorParameter() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionQualifiedConstructorParameter.txt"), + getNonCompilablePath("InputAntlr4AstRegressionQualifiedConstructorParameter.java")); + } + + @Test +- public void testJava15FinalLocalRecord() throws Exception { ++ void java15FinalLocalRecord() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionJava15FinalLocalRecord.txt"), + getNonCompilablePath("InputAntlr4AstRegressionJava15FinalLocalRecord.java"), +@@ -340,28 +340,28 @@ public class Antlr4AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testUnusualAnnotation() throws Exception { ++ void unusualAnnotation() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionUnusualAnnotation.txt"), + getPath("InputAntlr4AstRegressionUnusualAnnotation.java")); + } + + @Test +- public void testLambda() throws Exception { ++ void lambda() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionLambda.txt"), + getPath("InputAntlr4AstRegressionLambda.java")); + } + + @Test +- public void testExpressions() throws Exception { ++ void expressions() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionExpressions.txt"), + getPath("InputAntlr4AstRegressionExpressions.java")); + } + + @Test +- public void testInterfaceMemberAlternativePrecedence() throws Exception { ++ void interfaceMemberAlternativePrecedence() throws Exception { + verifyAst( + getPath("ExpectedAntlr4AstRegressionInterfaceRecordDef.txt"), + getNonCompilablePath("InputAntlr4AstRegressionInterfaceRecordDef.java")); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Java17AstRegressionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Java17AstRegressionTest.java +index 0f23af4e3..3065fbde9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Java17AstRegressionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/antlr4/Java17AstRegressionTest.java +@@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.grammar.antlr4; + import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; + import org.junit.jupiter.api.Test; + +-public class Java17AstRegressionTest extends AbstractTreeTestSupport { ++final class Java17AstRegressionTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -30,49 +30,49 @@ public class Java17AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testPatternsInSwitch() throws Exception { ++ void patternsInSwitch() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInSwitch.txt"), + getNonCompilablePath("InputAntlr4AstRegressionPatternsInSwitch.java")); + } + + @Test +- public void testPatternsInIfStatement() throws Exception { ++ void patternsInIfStatement() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInIfStatement.txt"), + getNonCompilablePath("InputAntlr4AstRegressionPatternsInIfStatement.java")); + } + + @Test +- public void testPatternsInWhile() throws Exception { ++ void patternsInWhile() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInWhile.txt"), + getNonCompilablePath("InputAntlr4AstRegressionPatternsInWhile.java")); + } + + @Test +- public void testPatternsInTernary() throws Exception { ++ void patternsInTernary() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInTernary.txt"), + getNonCompilablePath("InputAntlr4AstRegressionPatternsInTernary.java")); + } + + @Test +- public void testPatternsInFor() throws Exception { ++ void patternsInFor() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedAntlr4AstRegressionPatternsInFor.txt"), + getNonCompilablePath("InputAntlr4AstRegressionPatternsInFor.java")); + } + + @Test +- public void testPatternMatchingInSwitch() throws Exception { ++ void patternMatchingInSwitch() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedAntlr4AstRegressionPatternMatchingInSwitch.txt"), + getNonCompilablePath("InputAntlr4AstRegressionPatternMatchingInSwitch.java")); + } + + @Test +- public void testCaseDefault() throws Exception { ++ void caseDefault() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedAntlr4AstRegressionCaseDefault.txt"), + getNonCompilablePath("InputAntlr4AstRegressionCaseDefault.java")); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllBlockCommentsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllBlockCommentsTest.java +index ca85bca28..3cba90183 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllBlockCommentsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllBlockCommentsTest.java +@@ -20,6 +20,7 @@ + package com.puppycrawl.tools.checkstyle.grammar.comments; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +@@ -28,13 +29,12 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; +-import java.nio.charset.StandardCharsets; + import java.util.Arrays; + import java.util.LinkedHashSet; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class AllBlockCommentsTest extends AbstractModuleTestSupport { ++final class AllBlockCommentsTest extends AbstractModuleTestSupport { + + private static final Set ALL_COMMENTS = new LinkedHashSet<>(); + +@@ -46,10 +46,10 @@ public class AllBlockCommentsTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllBlockComments() throws Exception { ++ void allBlockComments() throws Exception { + final DefaultConfiguration checkConfig = createModuleConfig(BlockCommentListenerCheck.class); + final String path = getPath("InputFullOfBlockComments.java"); +- lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); ++ lineSeparator = CheckUtil.getLineSeparatorForFile(path, UTF_8); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verify(checkConfig, path, expected); + assertWithMessage("All comments should be empty").that(ALL_COMMENTS).isEmpty(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllSinglelineCommentsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllSinglelineCommentsTest.java +index 0d09713e6..26c1b0c33 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllSinglelineCommentsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/AllSinglelineCommentsTest.java +@@ -20,6 +20,7 @@ + package com.puppycrawl.tools.checkstyle.grammar.comments; + + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.DefaultConfiguration; +@@ -27,12 +28,11 @@ import com.puppycrawl.tools.checkstyle.api.AbstractCheck; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; +-import java.nio.charset.StandardCharsets; + import java.util.LinkedHashSet; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class AllSinglelineCommentsTest extends AbstractModuleTestSupport { ++final class AllSinglelineCommentsTest extends AbstractModuleTestSupport { + + private static final Set ALL_COMMENTS = new LinkedHashSet<>(); + +@@ -44,11 +44,11 @@ public class AllSinglelineCommentsTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllSinglelineComments() throws Exception { ++ void allSinglelineComments() throws Exception { + final DefaultConfiguration checkConfig = + createModuleConfig(SinglelineCommentListenerCheck.class); + final String path = getPath("InputFullOfSinglelineComments.java"); +- lineSeparator = CheckUtil.getLineSeparatorForFile(path, StandardCharsets.UTF_8); ++ lineSeparator = CheckUtil.getLineSeparatorForFile(path, UTF_8); + execute(checkConfig, path); + assertWithMessage("All comments should be empty").that(ALL_COMMENTS).isEmpty(); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java +index 0565af42a..42f04be3e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/comments/CommentsTest.java +@@ -26,7 +26,7 @@ import com.puppycrawl.tools.checkstyle.JavaParser; + import com.puppycrawl.tools.checkstyle.api.Comment; + import org.junit.jupiter.api.Test; + +-public class CommentsTest extends AbstractTreeTestSupport { ++final class CommentsTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -34,7 +34,7 @@ public class CommentsTest extends AbstractTreeTestSupport { + } + + @Test +- public void testCompareExpectedTreeWithInput1() throws Exception { ++ void compareExpectedTreeWithInput1() throws Exception { + verifyAst( + getPath("InputComments1Ast.txt"), + getPath("InputComments1.java"), +@@ -42,7 +42,7 @@ public class CommentsTest extends AbstractTreeTestSupport { + } + + @Test +- public void testCompareExpectedTreeWithInput2() throws Exception { ++ void compareExpectedTreeWithInput2() throws Exception { + verifyAst( + getPath("InputComments2Ast.txt"), + getPath("InputComments2.java"), +@@ -50,7 +50,7 @@ public class CommentsTest extends AbstractTreeTestSupport { + } + + @Test +- public void testToString() { ++ void testToString() { + final Comment comment = new Comment(new String[] {"value"}, 1, 2, 3); + assertWithMessage("Invalid toString result") + .that(comment.toString()) +@@ -59,7 +59,7 @@ public class CommentsTest extends AbstractTreeTestSupport { + } + + @Test +- public void testGetCommentMeasures() { ++ void getCommentMeasures() { + final String[] commentText = { + "/**", + " * Creates new instance.", +@@ -84,7 +84,7 @@ public class CommentsTest extends AbstractTreeTestSupport { + } + + @Test +- public void testIntersects() { ++ void intersects() { + final String[] commentText = { + "// compute a single number for start and end", "// to simplify conditional logic" + }; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java19/Java19AstRegressionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java19/Java19AstRegressionTest.java +index 84780cd8c..e1877d74b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java19/Java19AstRegressionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java19/Java19AstRegressionTest.java +@@ -22,7 +22,7 @@ package com.puppycrawl.tools.checkstyle.grammar.java19; + import com.puppycrawl.tools.checkstyle.AbstractTreeTestSupport; + import org.junit.jupiter.api.Test; + +-public class Java19AstRegressionTest extends AbstractTreeTestSupport { ++final class Java19AstRegressionTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -30,42 +30,42 @@ public class Java19AstRegressionTest extends AbstractTreeTestSupport { + } + + @Test +- public void testPatternsInSwitch() throws Exception { ++ void patternsInSwitch() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedJava19PatternsInSwitchLabels.txt"), + getNonCompilablePath("InputJava19PatternsInSwitchLabels.java")); + } + + @Test +- public void testPatternsInNullSwitch1() throws Exception { ++ void patternsInNullSwitch1() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedJava19PatternsInNullSwitch1.txt"), + getNonCompilablePath("InputJava19PatternsInNullSwitch1.java")); + } + + @Test +- public void testPatternsInNullSwitch2() throws Exception { ++ void patternsInNullSwitch2() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedJava19PatternsInNullSwitch2.txt"), + getNonCompilablePath("InputJava19PatternsInNullSwitch2.java")); + } + + @Test +- public void testAnnotationsOnBinding() throws Exception { ++ void annotationsOnBinding() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedJava19PatternsAnnotationsOnBinding.txt"), + getNonCompilablePath("InputJava19PatternsAnnotationsOnBinding.java")); + } + + @Test +- public void testTrickyWhenUsage() throws Exception { ++ void trickyWhenUsage() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedJava19PatternsTrickyWhenUsage.txt"), + getNonCompilablePath("InputJava19PatternsTrickyWhenUsage.java")); + } + + @Test +- public void testLotsOfOperators() throws Exception { ++ void lotsOfOperators() throws Exception { + verifyAst( + getNonCompilablePath("ExpectedJava19BindingsWithLotsOfOperators.txt"), + getNonCompilablePath("InputJava19BindingsWithLotsOfOperators.java")); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationTest.java +index f5e7e98c1..09f669d6b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class AnnotationTest extends AbstractModuleTestSupport { ++final class AnnotationTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,73 +31,73 @@ public class AnnotationTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSimpleTypeAnnotation() throws Exception { ++ void simpleTypeAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations1.java"), expected); + } + + @Test +- public void testAnnotationOnClass() throws Exception { ++ void annotationOnClass() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations2.java"), expected); + } + + @Test +- public void testClassCastTypeAnnotation() throws Exception { ++ void classCastTypeAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations3.java"), expected); + } + + @Test +- public void testMethodParametersTypeAnnotation() throws Exception { ++ void methodParametersTypeAnnotation() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations4.java"), expected); + } + + @Test +- public void testAnnotationInThrows() throws Exception { ++ void annotationInThrows() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations5.java"), expected); + } + + @Test +- public void testAnnotationInGeneric() throws Exception { ++ void annotationInGeneric() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations6.java"), expected); + } + + @Test +- public void testAnnotationOnConstructorCall() throws Exception { ++ void annotationOnConstructorCall() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations7.java"), expected); + } + + @Test +- public void testAnnotationNestedCall() throws Exception { ++ void annotationNestedCall() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations8.java"), expected); + } + + @Test +- public void testAnnotationOnWildcards() throws Exception { ++ void annotationOnWildcards() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations9.java"), expected); + } + + @Test +- public void testAnnotationInCatchParameters() throws Exception { ++ void annotationInCatchParameters() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations10.java"), expected); + } + + @Test +- public void testAnnotationInTypeParameters() throws Exception { ++ void annotationInTypeParameters() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations11.java"), expected); + } + + @Test +- public void testAnnotationOnVarargs() throws Exception { ++ void annotationOnVarargs() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotations12.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationsOnArrayTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationsOnArrayTest.java +index bb0f0eb89..5ab1e0347 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationsOnArrayTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/AnnotationsOnArrayTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class AnnotationsOnArrayTest extends AbstractModuleTestSupport { ++final class AnnotationsOnArrayTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class AnnotationsOnArrayTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputAnnotationsOnArray.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/DefaultMethodsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/DefaultMethodsTest.java +index dd256237d..fb63970f6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/DefaultMethodsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/DefaultMethodsTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class DefaultMethodsTest extends AbstractModuleTestSupport { ++final class DefaultMethodsTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,13 +31,13 @@ public class DefaultMethodsTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputDefaultMethods.java"), expected); + } + + @Test +- public void testSwitch() throws Exception { ++ void testSwitch() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputDefaultMethods2.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/LambdaTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/LambdaTest.java +index 871f726ce..a355babf8 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/LambdaTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/LambdaTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class LambdaTest extends AbstractModuleTestSupport { ++final class LambdaTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,109 +31,109 @@ public class LambdaTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLambdaInVariableInitialization() throws Exception { ++ void lambdaInVariableInitialization() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda1.java"), expected); + } + + @Test +- public void testWithoutArgsOneLineLambdaBody() throws Exception { ++ void withoutArgsOneLineLambdaBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda2.java"), expected); + } + + @Test +- public void testWithoutArgsFullLambdaBody() throws Exception { ++ void withoutArgsFullLambdaBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda3.java"), expected); + } + + @Test +- public void testWithOneArgWithOneLineBody() throws Exception { ++ void withOneArgWithOneLineBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda4.java"), expected); + } + + @Test +- public void testWithOneArgWithFullBody() throws Exception { ++ void withOneArgWithFullBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda5.java"), expected); + } + + @Test +- public void testWithOneArgWithoutTypeOneLineBody() throws Exception { ++ void withOneArgWithoutTypeOneLineBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda6.java"), expected); + } + + @Test +- public void testWithOneArgWithoutTypeFullBody() throws Exception { ++ void withOneArgWithoutTypeFullBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda7.java"), expected); + } + + @Test +- public void testWithFewArgsWithoutTypeOneLineBody() throws Exception { ++ void withFewArgsWithoutTypeOneLineBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda8.java"), expected); + } + + @Test +- public void testWithFewArgsWithoutTypeFullBody() throws Exception { ++ void withFewArgsWithoutTypeFullBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda9.java"), expected); + } + + @Test +- public void testWithOneArgWithoutParenthesesWithoutTypeOneLineBody() throws Exception { ++ void withOneArgWithoutParenthesesWithoutTypeOneLineBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda10.java"), expected); + } + + @Test +- public void testWithOneArgWithoutParenthesesWithoutTypeFullBody() throws Exception { ++ void withOneArgWithoutParenthesesWithoutTypeFullBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda11.java"), expected); + } + + @Test +- public void testWithFewArgWithTypeOneLine() throws Exception { ++ void withFewArgWithTypeOneLine() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda12.java"), expected); + } + + @Test +- public void testWithFewArgWithTypeFullBody() throws Exception { ++ void withFewArgWithTypeFullBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda13.java"), expected); + } + + @Test +- public void testWithMultilineBody() throws Exception { ++ void withMultilineBody() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda14.java"), expected); + } + + @Test +- public void testCasesFromSpec() throws Exception { ++ void casesFromSpec() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda15.java"), expected); + } + + @Test +- public void testWithTypecast() throws Exception { ++ void withTypecast() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda16.java"), expected); + } + + @Test +- public void testInAssignment() throws Exception { ++ void inAssignment() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda17.java"), expected); + } + + @Test +- public void testInTernary() throws Exception { ++ void inTernary() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputLambda18.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/MethodReferencesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/MethodReferencesTest.java +index c966e204e..499878518 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/MethodReferencesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/MethodReferencesTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class MethodReferencesTest extends AbstractModuleTestSupport { ++final class MethodReferencesTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,43 +31,43 @@ public class MethodReferencesTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodReferences.java"), expected); + } + + @Test +- public void testFromSpec() throws Exception { ++ void fromSpec() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodReferences2.java"), expected); + } + + @Test +- public void testGenericInPostfixExpressionBeforeReference() throws Exception { ++ void genericInPostfixExpressionBeforeReference() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodReferences3.java"), expected); + } + + @Test +- public void testArrayAfterGeneric() throws Exception { ++ void arrayAfterGeneric() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodReferences4.java"), expected); + } + + @Test +- public void testFromHibernate() throws Exception { ++ void fromHibernate() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodReferences5.java"), expected); + } + + @Test +- public void testFromSpring() throws Exception { ++ void fromSpring() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodReferences6.java"), expected); + } + + @Test +- public void testMethodReferences7() throws Exception { ++ void methodReferences7() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputMethodReferences7.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/ReceiverParameterTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/ReceiverParameterTest.java +index e4e911f1f..799c6eaa9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/ReceiverParameterTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/ReceiverParameterTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class ReceiverParameterTest extends AbstractModuleTestSupport { ++final class ReceiverParameterTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class ReceiverParameterTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputReceiverParameter.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/TypeUseAnnotationsOnQualifiedTypesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/TypeUseAnnotationsOnQualifiedTypesTest.java +index 9a30a04af..0599a6c4e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/TypeUseAnnotationsOnQualifiedTypesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/java8/TypeUseAnnotationsOnQualifiedTypesTest.java +@@ -23,7 +23,7 @@ import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.utils.CommonUtil; + import org.junit.jupiter.api.Test; + +-public class TypeUseAnnotationsOnQualifiedTypesTest extends AbstractModuleTestSupport { ++final class TypeUseAnnotationsOnQualifiedTypesTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -31,7 +31,7 @@ public class TypeUseAnnotationsOnQualifiedTypesTest extends AbstractModuleTestSu + } + + @Test +- public void testCanParse() throws Exception { ++ void canParse() throws Exception { + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + verifyWithInlineConfigParser(getPath("InputTypeUseAnnotationsOnQualifiedTypes.java"), expected); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/GeneratedJavadocTokenTypesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/GeneratedJavadocTokenTypesTest.java +index 16641ad21..f10776314 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/GeneratedJavadocTokenTypesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/GeneratedJavadocTokenTypesTest.java +@@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test; + * @noinspectionreason ClassIndependentOfModule - architecture of test modules requires this + * structure + */ +-public class GeneratedJavadocTokenTypesTest { ++final class GeneratedJavadocTokenTypesTest { + + private static final String MSG = + "Ensure that token numbers generated for the elements" +@@ -50,7 +50,7 @@ public class GeneratedJavadocTokenTypesTest { + * @see "https://github.com/checkstyle/checkstyle/issues/5186" + */ + @Test +- public void testTokenNumbers() { ++ void tokenNumbers() { + assertWithMessage(MSG).that(JavadocParser.LEADING_ASTERISK).isEqualTo(1); + assertWithMessage(MSG).that(JavadocParser.HTML_COMMENT_START).isEqualTo(2); + assertWithMessage(MSG).that(JavadocParser.DEPRECATED_CDATA_DO_NOT_USE).isEqualTo(3); +@@ -180,7 +180,7 @@ public class GeneratedJavadocTokenTypesTest { + * @see "https://github.com/checkstyle/checkstyle/issues/5186" + */ + @Test +- public void testRuleNumbers() { ++ void ruleNumbers() { + assertWithMessage(MSG).that(JavadocParser.RULE_javadoc).isEqualTo(0); + assertWithMessage(MSG).that(JavadocParser.RULE_htmlElement).isEqualTo(1); + assertWithMessage(MSG).that(JavadocParser.RULE_htmlElementStart).isEqualTo(2); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/JavadocParseTreeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/JavadocParseTreeTest.java +index 4d52645e8..59ae0619f 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/JavadocParseTreeTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/grammar/javadoc/JavadocParseTreeTest.java +@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test; + * @noinspection ClassOnlyUsedInOnePackage + * @noinspectionreason ClassOnlyUsedInOnePackage - class is internal tool, and only used in testing + */ +-public class JavadocParseTreeTest extends AbstractTreeTestSupport { ++final class JavadocParseTreeTest extends AbstractTreeTestSupport { + + @Override + protected String getPackageLocation() { +@@ -46,395 +46,395 @@ public class JavadocParseTreeTest extends AbstractTreeTestSupport { + } + + @Test +- public void oneSimpleHtmlTag() throws Exception { ++ void oneSimpleHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedOneSimpleHtmlTagAst.txt"), + getHtmlPath("InputOneSimpleHtmlTag.javadoc")); + } + + @Test +- public void textBeforeJavadocTags() throws Exception { ++ void textBeforeJavadocTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedTextBeforeJavadocTagsAst.txt"), + getDocPath("InputTextBeforeJavadocTags.javadoc")); + } + + @Test +- public void customJavadocTags() throws Exception { ++ void customJavadocTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedCustomJavadocTagsAst.txt"), + getDocPath("InputCustomJavadocTags.javadoc")); + } + + @Test +- public void javadocTagDescriptionWithInlineTags() throws Exception { ++ void javadocTagDescriptionWithInlineTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedJavadocTagDescriptionWithInlineTagsAst.txt"), + getDocPath("InputJavadocTagDescriptionWithInlineTags.javadoc")); + } + + @Test +- public void leadingAsterisks() throws Exception { ++ void leadingAsterisks() throws Exception { + verifyJavadocTree( + getPath("expectedLeadingAsterisksAst.txt"), getPath("InputLeadingAsterisks.javadoc")); + } + + @Test +- public void authorWithMailto() throws Exception { ++ void authorWithMailto() throws Exception { + verifyJavadocTree( + getDocPath("expectedAuthorWithMailtoAst.txt"), getDocPath("InputAuthorWithMailto.javadoc")); + } + + @Test +- public void htmlTagsInParagraph() throws Exception { ++ void htmlTagsInParagraph() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedHtmlTagsInParagraphAst.txt"), + getHtmlPath("InputHtmlTagsInParagraph.javadoc")); + } + + @Test +- public void linkInlineTags() throws Exception { ++ void linkInlineTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedLinkInlineTagsAst.txt"), getDocPath("InputLinkInlineTags.javadoc")); + } + + @Test +- public void seeReferenceWithFewNestedClasses() throws Exception { ++ void seeReferenceWithFewNestedClasses() throws Exception { + verifyJavadocTree( + getDocPath("expectedSeeReferenceWithFewNestedClassesAst.txt"), + getDocPath("InputSeeReferenceWithFewNestedClasses.javadoc")); + } + + @Test +- public void paramWithGeneric() throws Exception { ++ void paramWithGeneric() throws Exception { + verifyJavadocTree( + getDocPath("expectedParamWithGenericAst.txt"), getDocPath("InputParamWithGeneric.javadoc")); + } + + @Test +- public void serial() throws Exception { ++ void serial() throws Exception { + verifyJavadocTree(getDocPath("expectedSerialAst.txt"), getDocPath("InputSerial.javadoc")); + } + + @Test +- public void since() throws Exception { ++ void since() throws Exception { + verifyJavadocTree(getDocPath("expectedSinceAst.txt"), getDocPath("InputSince.javadoc")); + } + + @Test +- public void unclosedAndClosedParagraphs() throws Exception { ++ void unclosedAndClosedParagraphs() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedUnclosedAndClosedParagraphsAst.txt"), + getHtmlPath("InputUnclosedAndClosedParagraphs.javadoc")); + } + + @Test +- public void listWithUnclosedItemInUnclosedParagraph() throws Exception { ++ void listWithUnclosedItemInUnclosedParagraph() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedListWithUnclosedItemInUnclosedParagraphAst.txt"), + getHtmlPath("InputListWithUnclosedItemInUnclosedParagraph.javadoc")); + } + + @Test +- public void unclosedParagraphFollowedByJavadocTag() throws Exception { ++ void unclosedParagraphFollowedByJavadocTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedUnclosedParagraphFollowedByJavadocTagAst.txt"), + getHtmlPath("InputUnclosedParagraphFollowedByJavadocTag.javadoc")); + } + + @Test +- public void allJavadocInlineTags() throws Exception { ++ void allJavadocInlineTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedAllJavadocInlineTagsAst.txt"), + getDocPath("InputAllJavadocInlineTags.javadoc")); + } + + @Test +- public void docRootInheritDoc() throws Exception { ++ void docRootInheritDoc() throws Exception { + verifyJavadocTree( + getDocPath("expectedDocRootInheritDocAst.txt"), + getDocPath("InputDocRootInheritDoc.javadoc")); + } + + @Test +- public void fewWhiteSpacesAsSeparator() throws Exception { ++ void fewWhiteSpacesAsSeparator() throws Exception { + verifyJavadocTree( + getDocPath("expectedFewWhiteSpacesAsSeparatorAst.txt"), + getDocPath("InputFewWhiteSpacesAsSeparator.javadoc")); + } + + @Test +- public void mixedCaseOfHtmlTags() throws Exception { ++ void mixedCaseOfHtmlTags() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedMixedCaseOfHtmlTagsAst.txt"), + getHtmlPath("InputMixedCaseOfHtmlTags.javadoc")); + } + + @Test +- public void htmlComments() throws Exception { ++ void htmlComments() throws Exception { + verifyJavadocTree(getHtmlPath("expectedCommentsAst.txt"), getHtmlPath("InputComments.javadoc")); + } + + @Test +- public void negativeNumberInAttribute() throws Exception { ++ void negativeNumberInAttribute() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedNegativeNumberInAttributeAst.txt"), + getHtmlPath("InputNegativeNumberInAttribute.javadoc")); + } + + @Test +- public void dollarInLink() throws Exception { ++ void dollarInLink() throws Exception { + verifyJavadocTree( + getDocPath("expectedDollarInLinkAst.txt"), getDocPath("InputDollarInLink.javadoc")); + } + + @Test +- public void dotCharacterInCustomTags() throws Exception { ++ void dotCharacterInCustomTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedCustomTagWithDotAst.txt"), getDocPath("InputCustomTagWithDot.javadoc")); + } + + @Test +- public void testLinkToPackage() throws Exception { ++ void linkToPackage() throws Exception { + verifyJavadocTree( + getDocPath("expectedLinkToPackageAst.txt"), getDocPath("InputLinkToPackage.javadoc")); + } + + @Test +- public void testLeadingAsterisksExtended() throws Exception { ++ void leadingAsterisksExtended() throws Exception { + verifyJavadocTree( + getPath("expectedLeadingAsterisksExtendedAst.txt"), + getPath("InputLeadingAsterisksExtended.javadoc")); + } + + @Test +- public void testInlineCustomJavadocTag() throws Exception { ++ void inlineCustomJavadocTag() throws Exception { + verifyJavadocTree( + getDocPath("expectedInlineCustomJavadocTagAst.txt"), + getDocPath("InputInlineCustomJavadocTag.javadoc")); + } + + @Test +- public void testAttributeValueWithoutQuotes() throws Exception { ++ void attributeValueWithoutQuotes() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedAttributeValueWithoutQuotesAst.txt"), + getHtmlPath("InputAttributeValueWithoutQuotes.javadoc")); + } + + @Test +- public void testClosedOtherTag() throws Exception { ++ void closedOtherTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedClosedOtherTagAst.txt"), getHtmlPath("InputClosedOtherTag.javadoc")); + } + + @Test +- public void testAllStandardJavadocTags() throws Exception { ++ void allStandardJavadocTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedAllStandardJavadocTagsAst.txt"), + getDocPath("InputAllStandardJavadocTags.javadoc")); + } + + @Test +- public void testAsteriskInJavadocInlineTag() throws Exception { ++ void asteriskInJavadocInlineTag() throws Exception { + verifyJavadocTree( + getDocPath("expectedAsteriskInJavadocInlineTagAst.txt"), + getDocPath("InputAsteriskInJavadocInlineTag.javadoc")); + } + + @Test +- public void testAsteriskInLiteral() throws Exception { ++ void asteriskInLiteral() throws Exception { + verifyJavadocTree( + getDocPath("expectedAsteriskInLiteralAst.txt"), + getDocPath("InputAsteriskInLiteral.javadoc")); + } + + @Test +- public void testInnerBracesInCodeTag() throws Exception { ++ void innerBracesInCodeTag() throws Exception { + verifyJavadocTree( + getDocPath("expectedInnerBracesInCodeTagAst.txt"), + getDocPath("InputInnerBracesInCodeTag.javadoc")); + } + + @Test +- public void testNewlineAndAsteriskInParameters() throws Exception { ++ void newlineAndAsteriskInParameters() throws Exception { + verifyJavadocTree( + getDocPath("expectedNewlineAndAsteriskInParametersAst.txt"), + getDocPath("InputNewlineAndAsteriskInParameters.javadoc")); + } + + @Test +- public void testTwoLinkTagsInRow() throws Exception { ++ void twoLinkTagsInRow() throws Exception { + verifyJavadocTree( + getDocPath("expectedTwoLinkTagsInRowAst.txt"), getDocPath("InputTwoLinkTagsInRow.javadoc")); + } + + @Test +- public void testJavadocWithCrAsNewline() throws Exception { ++ void javadocWithCrAsNewline() throws Exception { + verifyJavadocTree( + getPath("expectedJavadocWithCrAsNewlineAst.txt"), + getPath("InputJavadocWithCrAsNewline.javadoc")); + } + + @Test +- public void testNestingWithSingletonElement() throws Exception { ++ void nestingWithSingletonElement() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedNestingWithSingletonElementAst.txt"), + getHtmlPath("InputNestingWithSingletonElement.javadoc")); + } + + @Test +- public void testVoidElements() throws Exception { ++ void voidElements() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedVoidElementsAst.txt"), getHtmlPath("InputVoidElements.javadoc")); + } + + @Test +- public void testHtmlVoidElementEmbed() throws Exception { ++ void htmlVoidElementEmbed() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedHtmlVoidElementEmbedAst.txt"), + getHtmlPath("InputHtmlVoidElementEmbed.javadoc")); + } + + @Test +- public void testSpaceBeforeDescriptionInBlockJavadocTags() throws Exception { ++ void spaceBeforeDescriptionInBlockJavadocTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedSpaceBeforeDescriptionInBlockJavadocTagsAst.txt"), + getDocPath("InputSpaceBeforeDescriptionInBlockJavadocTags.javadoc")); + } + + @Test +- public void testSpaceBeforeDescriptionInInlineTags() throws Exception { ++ void spaceBeforeDescriptionInInlineTags() throws Exception { + verifyJavadocTree( + getDocPath("expectedSpaceBeforeArgsInInlineTagsAst.txt"), + getDocPath("InputSpaceBeforeArgsInInlineTags.javadoc")); + } + + @Test +- public void testHtmlVoidElementKeygen() throws Exception { ++ void htmlVoidElementKeygen() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedHtmlVoidElementKeygenAst.txt"), + getHtmlPath("InputHtmlVoidElementKeygen.javadoc")); + } + + @Test +- public void testHtmlVoidElementSource() throws Exception { ++ void htmlVoidElementSource() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedHtmlVoidElementSourceAst.txt"), + getHtmlPath("InputHtmlVoidElementSource.javadoc")); + } + + @Test +- public void testHtmlVoidElementTrack() throws Exception { ++ void htmlVoidElementTrack() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedHtmlVoidElementTrackAst.txt"), + getHtmlPath("InputHtmlVoidElementTrack.javadoc")); + } + + @Test +- public void testHtmlVoidElementWbr() throws Exception { ++ void htmlVoidElementWbr() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedHtmlVoidElementWbrAst.txt"), + getHtmlPath("InputHtmlVoidElementWbr.javadoc")); + } + + @Test +- public void testOptgroupHtmlTag() throws Exception { ++ void optgroupHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedOptgroupHtmlTagAst.txt"), getHtmlPath("InputOptgroupHtmlTag.javadoc")); + } + + @Test +- public void testNonTightOptgroupHtmlTag() throws Exception { ++ void nonTightOptgroupHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedNonTightOptgroupHtmlTagAst.txt"), + getHtmlPath("InputNonTightOptgroupHtmlTag.javadoc")); + } + + @Test +- public void testRbHtmlTag() throws Exception { ++ void rbHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedRbHtmlTagAst.txt"), getHtmlPath("InputRbHtmlTag.javadoc")); + } + + @Test +- public void testNonTightRbHtmlTag() throws Exception { ++ void nonTightRbHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedNonTightRbHtmlTagAst.txt"), + getHtmlPath("InputNonTightRbHtmlTag.javadoc")); + } + + @Test +- public void testRtHtmlTag() throws Exception { ++ void rtHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedRtHtmlTagAst.txt"), getHtmlPath("InputRtHtmlTag.javadoc")); + } + + @Test +- public void testNonTightRtHtmlTag() throws Exception { ++ void nonTightRtHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedNonTightRtHtmlTagAst.txt"), + getHtmlPath("InputNonTightRtHtmlTag.javadoc")); + } + + @Test +- public void testRtcHtmlTag() throws Exception { ++ void rtcHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedRtcHtmlTagAst.txt"), getHtmlPath("InputRtcHtmlTag.javadoc")); + } + + @Test +- public void testNonTightRtcHtmlTag() throws Exception { ++ void nonTightRtcHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedNonTightRtcHtmlTagAst.txt"), + getHtmlPath("InputNonTightRtcHtmlTag.javadoc")); + } + + @Test +- public void testRpHtmlTag() throws Exception { ++ void rpHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedRpHtmlTagAst.txt"), getHtmlPath("InputRpHtmlTag.javadoc")); + } + + @Test +- public void testNonTightRpHtmlTag() throws Exception { ++ void nonTightRpHtmlTag() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedNonTightRpHtmlTagAst.txt"), + getHtmlPath("InputNonTightRpHtmlTag.javadoc")); + } + + @Test +- public void testLeadingAsteriskAfterSeeTag() throws Exception { ++ void leadingAsteriskAfterSeeTag() throws Exception { + verifyJavadocTree( + getDocPath("expectedLeadingAsteriskAfterSeeTagAst.txt"), + getDocPath("InputLeadingAsteriskAfterSeeTag.javadoc")); + } + + @Test +- public void testUppercaseInPackageName() throws Exception { ++ void uppercaseInPackageName() throws Exception { + verifyJavadocTree( + getDocPath("expectedUppercaseInPackageNameAst.txt"), + getDocPath("InputUppercaseInPackageName.javadoc")); + } + + @Test +- public void testParagraph() throws Exception { ++ void paragraph() throws Exception { + verifyJavadocTree( + getHtmlPath("expectedParagraphAst.txt"), getHtmlPath("InputParagraph.javadoc")); + } + + @Test +- public void testCdata() throws Exception { ++ void cdata() throws Exception { + verifyJavadocTree(getHtmlPath("expectedCdataAst.txt"), getHtmlPath("InputCdata.javadoc")); + } + + @Test +- public void testCrAsNewlineMultiline() throws Exception { ++ void crAsNewlineMultiline() throws Exception { + verifyJavadocTree( + getPath("expectedCrAsNewlineMultiline.txt"), getPath("InputCrAsNewlineMultiline.javadoc")); + } + + @Test +- public void testDosLineEndingAsNewlineMultiline() throws Exception { ++ void dosLineEndingAsNewlineMultiline() throws Exception { + verifyJavadocTree( + getPath("expectedDosLineEndingAsNewlineMultiline.txt"), + getPath("InputDosLineEndingAsNewlineMultiline.javadoc")); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/gui/CodeSelectorPresentationTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/gui/CodeSelectorPresentationTest.java +index d2b766030..2f8406073 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/CodeSelectorPresentationTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/CodeSelectorPresentationTest.java +@@ -32,7 +32,7 @@ import java.util.List; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class CodeSelectorPresentationTest extends AbstractPathTestSupport { ++final class CodeSelectorPresentationTest extends AbstractPathTestSupport { + + private MainFrameModel model; + +@@ -41,7 +41,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { + private ImmutableList linesToPosition; + + @BeforeEach +- public void loadFile() throws Exception { ++ void loadFile() throws Exception { + model = new MainFrameModel(); + model.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); + model.openFile(new File(getPath("InputCodeSelectorPresentation.java"))); +@@ -73,7 +73,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testDetailASTSelection() { ++ void detailASTSelection() { + final CodeSelectorPresentation selector = new CodeSelectorPresentation(tree, linesToPosition); + selector.findSelectionPositions(); + assertWithMessage("Invalid selection start").that(selector.getSelectionStart()).isEqualTo(94); +@@ -81,7 +81,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testDetailASTLeafSelection() { ++ void detailASTLeafSelection() { + final DetailAST leaf = tree.getLastChild().getFirstChild(); + final CodeSelectorPresentation selector = new CodeSelectorPresentation(leaf, linesToPosition); + selector.findSelectionPositions(); +@@ -90,7 +90,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testDetailASTNoSelection() { ++ void detailASTNoSelection() { + final DetailAST leaf = tree.getFirstChild(); + final CodeSelectorPresentation selector = new CodeSelectorPresentation(leaf, linesToPosition); + selector.findSelectionPositions(); +@@ -99,7 +99,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testDetailNodeSelection() { ++ void detailNodeSelection() { + final DetailNode javadoc = + (DetailNode) + model +@@ -113,7 +113,7 @@ public class CodeSelectorPresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testDetailNodeLeafSelection() { ++ void detailNodeLeafSelection() { + final DetailNode javadoc = + (DetailNode) + model +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModelTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModelTest.java +index e03a1a444..0421a8286 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModelTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameModelTest.java +@@ -33,7 +33,7 @@ import java.util.Locale; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class MainFrameModelTest extends AbstractModuleTestSupport { ++final class MainFrameModelTest extends AbstractModuleTestSupport { + + private static final String FILE_NAME_TEST_DATA = "InputMainFrameModel.java"; + private static final String FILE_NAME_NON_EXISTENT = "non-existent.file"; +@@ -49,13 +49,13 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @BeforeEach +- public void prepareTestData() throws IOException { ++ void prepareTestData() throws IOException { + model = new MainFrameModel(); + testData = new File(getPath(FILE_NAME_TEST_DATA)); + } + + @Test +- public void testParseModeEnum() { ++ void parseModeEnum() { + for (final ParseMode parseMode : ParseMode.values()) { + switch (parseMode) { + case PLAIN_JAVA: +@@ -80,7 +80,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileWithParseModePlainJava() throws Exception { ++ void openFileWithParseModePlainJava() throws Exception { + // Default parse mode: Plain Java + model.openFile(testData); + verifyCorrectTestDataInFrameModel(); +@@ -90,7 +90,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileWithParseModeJavaWithComments() throws Exception { ++ void openFileWithParseModeJavaWithComments() throws Exception { + model.setParseMode(ParseMode.JAVA_WITH_COMMENTS); + model.openFile(testData); + +@@ -98,7 +98,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileWithParseModeJavaWithJavadocAndComments() throws Exception { ++ void openFileWithParseModeJavaWithJavadocAndComments() throws Exception { + model.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); + model.openFile(testData); + +@@ -106,7 +106,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileNullParameter() throws Exception { ++ void openFileNullParameter() throws Exception { + model.openFile(testData); + + model.openFile(null); +@@ -116,7 +116,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileNullParameter2() throws Exception { ++ void openFileNullParameter2() throws Exception { + model.openFile(null); + + assertWithMessage("Test is null").that(model.getText()).isNull(); +@@ -128,7 +128,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileNonExistentFile() throws IOException { ++ void openFileNonExistentFile() throws IOException { + final File nonExistentFile = new File(getPath(FILE_NAME_NON_EXISTENT)); + + try { +@@ -147,7 +147,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileNonCompilableFile() throws IOException { ++ void openFileNonCompilableFile() throws IOException { + final File nonCompilableFile = new File(getNonCompilablePath(FILE_NAME_NON_COMPILABLE)); + + try { +@@ -196,8 +196,8 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShouldAcceptDirectory() { +- final File directory = mock(File.class); ++ void shouldAcceptDirectory() { ++ final File directory = mock(); + when(directory.isDirectory()).thenReturn(true); + assertWithMessage("MainFrame should accept directory") + .that(MainFrameModel.shouldAcceptFile(directory)) +@@ -205,7 +205,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShouldAcceptFile() throws IOException { ++ void shouldAcceptFile() throws IOException { + final File javaFile = new File(getPath(FILE_NAME_TEST_DATA)); + assertWithMessage("MainFrame should accept java file") + .that(MainFrameModel.shouldAcceptFile(javaFile)) +@@ -213,8 +213,8 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShouldNotAcceptNonJavaFile() { +- final File nonJavaFile = mock(File.class); ++ void shouldNotAcceptNonJavaFile() { ++ final File nonJavaFile = mock(); + when(nonJavaFile.isDirectory()).thenReturn(false); + when(nonJavaFile.getName()).thenReturn(FILE_NAME_NON_JAVA); + assertWithMessage("MainFrame should not accept non-Java file") +@@ -223,7 +223,7 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testShouldNotAcceptNonExistentFile() throws IOException { ++ void shouldNotAcceptNonExistentFile() throws IOException { + final File nonExistentFile = new File(getPath(FILE_NAME_NON_EXISTENT)); + assertWithMessage("MainFrame should not accept non-existent file") + .that(MainFrameModel.shouldAcceptFile(nonExistentFile)) +@@ -231,9 +231,9 @@ public class MainFrameModelTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOpenFileForUnknownParseMode() throws IOException { ++ void openFileForUnknownParseMode() throws IOException { + final File javaFile = new File(getPath(FILE_NAME_TEST_DATA)); +- final ParseMode mock = mock(ParseMode.class); ++ final ParseMode mock = mock(); + model.setParseMode(mock); + final IllegalArgumentException ex = + assertThrows( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameTest.java +index 100b97236..39be9d467 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainFrameTest.java +@@ -46,7 +46,7 @@ import org.junit.jupiter.api.Test; + import org.mockito.MockedConstruction; + import org.mockito.MockedStatic; + +-public class MainFrameTest extends AbstractGuiTestSupport { ++final class MainFrameTest extends AbstractGuiTestSupport { + + private static final String TEST_FILE_NAME = "InputMainFrame.java"; + private static final String NON_EXISTENT_FILE_NAME = "non-existent.file"; +@@ -59,17 +59,17 @@ public class MainFrameTest extends AbstractGuiTestSupport { + } + + @BeforeEach +- public void prepare() { ++ void prepare() { + mainFrame = new MainFrame(); + } + + @AfterEach +- public void tearDown() { ++ void tearDown() { + Arrays.stream(mainFrame.getOwnedWindows()).forEach(Window::dispose); + } + + @Test +- public void testOpenFile() throws IOException { ++ void openFile() throws IOException { + mainFrame.openFile(new File(getPath(TEST_FILE_NAME))); + assertWithMessage("Unexpected frame title") + .that(mainFrame.getTitle()) +@@ -83,7 +83,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { + * @throws IOException if I/O exception occurs while forming the path. + */ + @Test +- public void testOpenNonExistentFile() throws IOException { ++ void openNonExistentFile() throws IOException { + final File file = new File(getPath(NON_EXISTENT_FILE_NAME)); + try (MockedStatic optionPane = mockStatic(JOptionPane.class)) { + mainFrame.openFile(file); +@@ -99,7 +99,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { + } + + @Test +- public void testChangeMode() { ++ void changeMode() { + final JComboBox modesCombobox = + findComponentByName(mainFrame, "modesCombobox"); + modesCombobox.setSelectedIndex(MainFrameModel.ParseMode.JAVA_WITH_COMMENTS.ordinal()); +@@ -117,7 +117,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { + * @throws IOException if I/O exception occurs while forming the path. + */ + @Test +- public void testOpenFileButton() throws IOException { ++ void openFileButton() throws IOException { + final JButton openFileButton = findComponentByName(mainFrame, "openFileButton"); + final File testFile = new File(getPath(TEST_FILE_NAME)); + try (MockedConstruction mocked = +@@ -139,7 +139,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { + * JFileChooser} is mocked to obtain an instance of {@code JavaFileFilter} class. + */ + @Test +- public void testFileFilter() { ++ void fileFilter() { + final JButton openFileButton = findComponentByName(mainFrame, "openFileButton"); + try (MockedConstruction mocked = + mockConstruction( +@@ -162,7 +162,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { + } + + @Test +- public void testExpandButton() { ++ void expandButton() { + final JButton expandButton = findComponentByName(mainFrame, "expandButton"); + final JTextArea xpathTextArea = findComponentByName(mainFrame, "xpathTextArea"); + expandButton.doClick(); +@@ -176,7 +176,7 @@ public class MainFrameTest extends AbstractGuiTestSupport { + } + + @Test +- public void testFindNodeButton() throws IOException { ++ void findNodeButton() throws IOException { + mainFrame.openFile(new File(getPath(TEST_FILE_NAME))); + final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); + final JTextArea xpathTextArea = findComponentByName(mainFrame, "xpathTextArea"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainTest.java +index 326dced92..bf8b770c4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/MainTest.java +@@ -28,7 +28,7 @@ import javax.swing.SwingUtilities; + import org.junit.jupiter.params.ParameterizedTest; + import org.junit.jupiter.params.provider.ValueSource; + +-public class MainTest extends AbstractGuiTestSupport { ++final class MainTest extends AbstractGuiTestSupport { + + @Override + protected String getPackageLocation() { +@@ -43,7 +43,7 @@ public class MainTest extends AbstractGuiTestSupport { + */ + @ParameterizedTest + @ValueSource(strings = {";", "InputMain.java"}) +- public void testMain(String argList) throws Exception { ++ void main(String argList) throws Exception { + final String[] args = argList.split(";"); + for (int i = 0; i < args.length; i++) { + args[i] = getPath(args[i]); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTablePresentationTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTablePresentationTest.java +index e74b1cb09..aa69b2b3e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTablePresentationTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/ParseTreeTablePresentationTest.java +@@ -34,7 +34,7 @@ import java.io.File; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { ++final class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + + private DetailAST tree; + +@@ -44,7 +44,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @BeforeEach +- public void loadTree() throws Exception { ++ void loadTree() throws Exception { + tree = + JavaParser.parseFile( + new File(getPath("InputParseTreeTablePresentation.java")), +@@ -54,7 +54,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testRoot() throws Exception { ++ void root() throws Exception { + final DetailAST root = + JavaParser.parseFile( + new File(getPath("InputParseTreeTablePresentation.java")), +@@ -63,13 +63,13 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testChildCount() { ++ void childCount() { + final int childCount = new ParseTreeTablePresentation(null).getChildCount(tree); + assertWithMessage("Invalid child count").that(childCount).isEqualTo(5); + } + + @Test +- public void testChildCountInJavaAndJavadocMode() { ++ void childCountInJavaAndJavadocMode() { + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); + final int childCount = parseTree.getChildCount(tree); +@@ -77,7 +77,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testChild() { ++ void child() { + final Object child = new ParseTreeTablePresentation(null).getChild(tree, 1); + assertWithMessage("Invalid child type").that(child).isInstanceOf(DetailAST.class); + final int type = ((DetailAST) child).getType(); +@@ -87,7 +87,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testChildInJavaAndJavadocMode() { ++ void childInJavaAndJavadocMode() { + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); + final Object child = parseTree.getChild(tree, 1); +@@ -99,7 +99,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testCommentChildCount() { ++ void commentChildCount() { + final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_COMMENTS); +@@ -108,7 +108,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testCommentChildCountInJavaAndJavadocMode() { ++ void commentChildCountInJavaAndJavadocMode() { + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); + final DetailAST commentContentNode = +@@ -123,7 +123,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testCommentChildInJavaAndJavadocMode() { ++ void commentChildInJavaAndJavadocMode() { + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); + final DetailAST commentContentNode = +@@ -138,7 +138,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testJavadocCommentChildCount() { ++ void javadocCommentChildCount() { + final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + final int commentChildCount = parseTree.getChildCount(commentContentNode); +@@ -149,7 +149,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testJavadocCommentChild() { ++ void javadocCommentChild() { + final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); +@@ -167,7 +167,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testJavadocChildCount() { ++ void javadocChildCount() { + final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); +@@ -180,7 +180,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testJavadocChild() { ++ void javadocChild() { + final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + parseTree.setParseMode(ParseMode.JAVA_WITH_JAVADOC_AND_COMMENTS); +@@ -195,7 +195,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetIndexOfChild() { ++ void getIndexOfChild() { + DetailAST ithChild = tree.getFirstChild(); + assertWithMessage("Child must not be null").that(ithChild).isNotNull(); + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); +@@ -225,7 +225,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + * + */ + @Test +- public void testGetValueAt() { ++ void getValueAt() { + final DetailAST node = tree.getFirstChild().getNextSibling().getNextSibling().getNextSibling(); + + assertWithMessage("Expected a non-null identifier node here").that(node).isNotNull(); +@@ -253,7 +253,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetValueAtDetailNode() { ++ void getValueAtDetailNode() { + final DetailAST commentContentNode = tree.getFirstChild().getNextSibling().getFirstChild(); + assertWithMessage("Comment node cannot be null").that(commentContentNode).isNotNull(); + final int nodeType = commentContentNode.getType(); +@@ -292,7 +292,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testColumnMethods() { ++ void columnMethods() { + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + assertWithMessage("Invalid type") + .that(parseTree.getColumnClass(0)) +@@ -313,7 +313,7 @@ public class ParseTreeTablePresentationTest extends AbstractPathTestSupport { + } + + @Test +- public void testColumnNames() { ++ void columnNames() { + final ParseTreeTablePresentation parseTree = new ParseTreeTablePresentation(null); + assertWithMessage("Invalid column count").that(parseTree.getColumnCount()).isEqualTo(5); + assertWithMessage("Invalid column name").that(parseTree.getColumnName(0)).isEqualTo("Tree"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/gui/TreeTableTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/gui/TreeTableTest.java +index ab115145d..f59d3c222 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/gui/TreeTableTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/gui/TreeTableTest.java +@@ -35,7 +35,7 @@ import javax.swing.tree.TreePath; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class TreeTableTest extends AbstractGuiTestSupport { ++final class TreeTableTest extends AbstractGuiTestSupport { + + private static final String TEST_FILE_NAME = "InputTreeTable.java"; + +@@ -47,7 +47,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @BeforeEach +- public void prepare() throws Exception { ++ void prepare() throws Exception { + final MainFrameModel model = new MainFrameModel(); + model.openFile(new File(getPath(TEST_FILE_NAME))); + treeTable = new TreeTable(model.getParseTreeTableModel()); +@@ -58,7 +58,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testExpandOnMouseDoubleClick() { ++ void expandOnMouseDoubleClick() { + final MouseEvent mouseDoubleClickEvent = + new MouseEvent(treeTable, MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, 2, false); + assertWithMessage("The tree should be initially expanded") +@@ -75,7 +75,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testNothingChangedOnMouseSingleClick() { ++ void nothingChangedOnMouseSingleClick() { + final MouseEvent mouseSingleClickEvent = + new MouseEvent(treeTable, MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, 1, false); + assertWithMessage("The tree should be initially expanded") +@@ -88,7 +88,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testExpandOnEnterKey() { ++ void expandOnEnterKey() { + final ActionEvent expandCollapseActionEvent = + new ActionEvent(treeTable, ActionEvent.ACTION_PERFORMED, "expand/collapse"); + final ActionListener actionForEnter = +@@ -107,7 +107,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testFindNodesAllClassDefs() throws IOException { ++ void findNodesAllClassDefs() throws IOException { + final MainFrame mainFrame = new MainFrame(); + mainFrame.openFile(new File(getPath("InputTreeTableXpathAreaPanel.java"))); + final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); +@@ -128,7 +128,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testFindNodesIdent() throws IOException { ++ void findNodesIdent() throws IOException { + final MainFrame mainFrame = new MainFrame(); + mainFrame.openFile(new File(getPath("InputTreeTableXpathAreaPanel.java"))); + final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); +@@ -163,7 +163,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testFindNodesMissingElements() throws IOException { ++ void findNodesMissingElements() throws IOException { + final MainFrame mainFrame = new MainFrame(); + mainFrame.openFile(new File(getPath("InputTreeTableXpathAreaPanel.java"))); + final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); +@@ -179,7 +179,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testFindNodesUnexpectedTokenAtStart() throws IOException { ++ void findNodesUnexpectedTokenAtStart() throws IOException { + final MainFrame mainFrame = new MainFrame(); + mainFrame.openFile(new File(getPath("InputTreeTableXpathAreaPanel.java"))); + final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); +@@ -195,7 +195,7 @@ public class TreeTableTest extends AbstractGuiTestSupport { + } + + @Test +- public void testFindNodesInvalidCharacterInExpression() throws IOException { ++ void findNodesInvalidCharacterInExpression() throws IOException { + final MainFrame mainFrame = new MainFrame(); + mainFrame.openFile(new File(getPath("InputTreeTableXpathAreaPanel.java"))); + final JButton findNodeButton = findComponentByName(mainFrame, "findNodeButton"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java +index 9c8c54921..7d11d9bb6 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllChecksTest.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; +@@ -53,11 +54,10 @@ import java.util.Map.Entry; + import java.util.Properties; + import java.util.Set; + import java.util.TreeMap; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + import org.junit.jupiter.api.Test; + +-public class AllChecksTest extends AbstractModuleTestSupport { ++final class AllChecksTest extends AbstractModuleTestSupport { + + private static final Locale[] ALL_LOCALES = { + Locale.CHINESE, +@@ -85,20 +85,20 @@ public class AllChecksTest extends AbstractModuleTestSupport { + Stream.of( + // we use GenericWhitespace for this behavior + "GENERIC_START", "GENERIC_END") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "AbbreviationAsWordInName", + Stream.of( + // enum values should be uppercase, we use EnumValueNameCheck instead + "ENUM_CONSTANT_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "FinalLocalVariable", + Stream.of( + // we prefer all parameters be effectively final as to not damage readability + // we use ParameterAssignmentCheck to enforce this + "PARAMETER_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + // we have no need to block these specific tokens + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "IllegalToken", +@@ -280,7 +280,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "TEXT_BLOCK_LITERAL_END", + "LITERAL_YIELD", + "SWITCH_RULE") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + // we have no need to block specific token text + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "IllegalTokenText", +@@ -294,7 +294,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "STRING_LITERAL", + "CHAR_LITERAL", + "TEXT_BLOCK_CONTENT") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + // we do not use this check as it is deprecated + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "WriteTag", +@@ -305,7 +305,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "ANNOTATION_FIELD_DEF", + "RECORD_DEF", + "COMPACT_CTOR_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + // state of the configuration when test was made until reason found in + // https://github.com/checkstyle/checkstyle/issues/3730 + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( +@@ -319,7 +319,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "VARIABLE_DEF", + "RECORD_DEF", + "COMPACT_CTOR_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "NoLineWrap", + Stream.of( +@@ -334,33 +334,33 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "ENUM_DEF", + "INTERFACE_DEF", + "RECORD_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "NoWhitespaceAfter", + Stream.of( + // whitespace after is preferred + "TYPECAST", "LITERAL_SYNCHRONIZED") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "SeparatorWrap", + Stream.of( + // needs context to decide what type of parentheses should be separated or not + // which this check does not provide + "LPAREN", "RPAREN") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "NeedBraces", + Stream.of( + // we prefer no braces here as it looks unusual even though they help avoid sharing + // scope of variables + "LITERAL_DEFAULT", "LITERAL_CASE") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "FinalParameters", + Stream.of( + // we prefer these to be effectively final as to not damage readability + "FOR_EACH_CLAUSE", "LITERAL_CATCH") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + CHECKSTYLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "WhitespaceAround", + Stream.of( +@@ -371,7 +371,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "WILDCARD_TYPE", + "GENERIC_END", + "GENERIC_START") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + + // google + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( +@@ -380,13 +380,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { + // state of the configuration when test was made until reason found in + // https://github.com/checkstyle/checkstyle/issues/3730 + "ANNOTATION_DEF", "ANNOTATION_FIELD_DEF", "ENUM_CONSTANT_DEF", "PACKAGE_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "AbbreviationAsWordInName", + Stream.of( + // enum values should be uppercase + "ENUM_CONSTANT_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "NoLineWrap", + Stream.of( +@@ -399,7 +399,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "INTERFACE_DEF", + "RECORD_DEF", + "COMPACT_CTOR_DEF") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "SeparatorWrap", + Stream.of( +@@ -416,13 +416,13 @@ public class AllChecksTest extends AbstractModuleTestSupport { + // which this check does not provide + "LPAREN", + "RPAREN") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "NeedBraces", + Stream.of( + // google doesn't require or prevent braces on these + "LAMBDA", "LITERAL_DEFAULT", "LITERAL_CASE") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "EmptyBlock", + Stream.of( +@@ -441,7 +441,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "LITERAL_SYNCHRONIZED", + "LITERAL_WHILE", + "STATIC_INIT") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "WhitespaceAround", + Stream.of( +@@ -453,7 +453,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "GENERIC_START", + "GENERIC_END", + "WILDCARD_TYPE") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "IllegalTokenText", + Stream.of( +@@ -467,7 +467,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + "STRING_LITERAL", + "CHAR_LITERAL", + "TEXT_BLOCK_CONTENT") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "OperatorWrap", + Stream.of( +@@ -488,7 +488,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + // COLON token ignored in check config, explained in + // https://github.com/checkstyle/checkstyle/issues/4122 + "COLON") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + GOOGLE_TOKENS_IN_CONFIG_TO_IGNORE.put( + "NoWhitespaceBefore", + Stream.of( +@@ -498,7 +498,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + // whitespace is necessary between a type annotation and ellipsis + // according '4.6.2 Horizontal whitespace point 9' + "ELLIPSIS") +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + INTERNAL_MODULES = + Definitions.INTERNAL_MODULES.stream() + .map( +@@ -506,7 +506,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + final String[] packageTokens = moduleName.split("\\."); + return packageTokens[packageTokens.length - 1]; + }) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + + @Override +@@ -515,7 +515,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllModulesWithDefaultConfiguration() throws Exception { ++ void allModulesWithDefaultConfiguration() throws Exception { + final String inputFilePath = getPath("InputAllChecksDefaultConfig.java"); + final String[] expected = CommonUtil.EMPTY_STRING_ARRAY; + +@@ -535,7 +535,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testDefaultTokensAreSubsetOfAcceptableTokens() throws Exception { ++ void defaultTokensAreSubsetOfAcceptableTokens() throws Exception { + for (Class check : CheckUtil.getCheckstyleChecks()) { + if (AbstractCheck.class.isAssignableFrom(check)) { + final AbstractCheck testedCheck = +@@ -552,7 +552,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredTokensAreSubsetOfAcceptableTokens() throws Exception { ++ void requiredTokensAreSubsetOfAcceptableTokens() throws Exception { + for (Class check : CheckUtil.getCheckstyleChecks()) { + if (AbstractCheck.class.isAssignableFrom(check)) { + final AbstractCheck testedCheck = +@@ -569,7 +569,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRequiredTokensAreSubsetOfDefaultTokens() throws Exception { ++ void requiredTokensAreSubsetOfDefaultTokens() throws Exception { + for (Class check : CheckUtil.getCheckstyleChecks()) { + if (AbstractCheck.class.isAssignableFrom(check)) { + final AbstractCheck testedCheck = +@@ -586,7 +586,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllModulesHaveMultiThreadAnnotation() throws Exception { ++ void allModulesHaveMultiThreadAnnotation() throws Exception { + for (Class module : CheckUtil.getCheckstyleModules()) { + if (ModuleReflectionUtil.isRootModule(module) + || ModuleReflectionUtil.isFilterModule(module) +@@ -606,7 +606,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllModulesAreReferencedInConfigFile() throws Exception { ++ void allModulesAreReferencedInConfigFile() throws Exception { + final Set modulesReferencedInConfig = CheckUtil.getConfigCheckStyleModules(); + final Set moduleNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); + +@@ -623,7 +623,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllCheckTokensAreReferencedInCheckstyleConfigFile() throws Exception { ++ void allCheckTokensAreReferencedInCheckstyleConfigFile() throws Exception { + final Configuration configuration = + ConfigurationUtil.loadConfiguration("config/checkstyle-checks.xml"); + +@@ -632,7 +632,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllCheckTokensAreReferencedInGoogleConfigFile() throws Exception { ++ void allCheckTokensAreReferencedInGoogleConfigFile() throws Exception { + final Configuration configuration = + ConfigurationUtil.loadConfiguration("src/main/resources/google_checks.xml"); + +@@ -730,7 +730,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllCheckstyleModulesHaveXdocDocumentation() throws Exception { ++ void allCheckstyleModulesHaveXdocDocumentation() throws Exception { + final Set checkstyleModulesNames = + CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); + final Set modulesNamesWhichHaveXdocs = XdocUtil.getModulesNamesWhichHaveXdoc(); +@@ -752,7 +752,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllCheckstyleModulesInCheckstyleConfig() throws Exception { ++ void allCheckstyleModulesInCheckstyleConfig() throws Exception { + final Set configChecks = CheckUtil.getConfigCheckStyleModules(); + final Set moduleNames = CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()); + moduleNames.removeAll(INTERNAL_MODULES); +@@ -764,7 +764,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllCheckstyleChecksHaveMessage() throws Exception { ++ void allCheckstyleChecksHaveMessage() throws Exception { + for (Class module : CheckUtil.getCheckstyleChecks()) { + final String name = module.getSimpleName(); + final Set messages = CheckUtil.getCheckMessages(module, false); +@@ -783,7 +783,7 @@ public class AllChecksTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAllCheckstyleMessages() throws Exception { ++ void allCheckstyleMessages() throws Exception { + final Map> usedMessages = new TreeMap<>(); + + // test validity of messages from modules +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllTestsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllTestsTest.java +index 556e3e5bd..7c076dc01 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllTestsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/AllTestsTest.java +@@ -42,10 +42,10 @@ import org.junit.jupiter.api.Test; + * @noinspectionreason ClassIndependentOfModule - architecture of test modules requires this + * structure + */ +-public class AllTestsTest { ++final class AllTestsTest { + + @Test +- public void testAllInputsHaveTest() throws Exception { ++ void allInputsHaveTest() throws Exception { + final Map> allTests = new HashMap<>(); + + walk( +@@ -69,7 +69,7 @@ public class AllTestsTest { + } + + @Test +- public void testAllTestsHaveProductionCode() throws Exception { ++ void allTestsHaveProductionCode() throws Exception { + final Map> allTests = new HashMap<>(); + + walk( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitCyclesCheckTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitCyclesCheckTest.java +index 36d474cb7..122eb0521 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitCyclesCheckTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitCyclesCheckTest.java +@@ -28,7 +28,7 @@ import com.tngtech.archunit.lang.ArchRule; + import com.tngtech.archunit.library.freeze.FreezingArchRule; + import org.junit.jupiter.api.Test; + +-public class ArchUnitCyclesCheckTest { ++final class ArchUnitCyclesCheckTest { + + /** + * This test checks that The frozen violations are present in {@code config/archunit-store} directory. + */ + @Test +- public void testSlicesShouldBeFreeOfCycles() { ++ void slicesShouldBeFreeOfCycles() { + final JavaClasses importedClasses = + new ClassFileImporter() + .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java +index ca013b280..0b81f06ee 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitSuperClassTest.java +@@ -41,7 +41,7 @@ import java.util.Optional; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class ArchUnitSuperClassTest { ++final class ArchUnitSuperClassTest { + + /** + * Classes not abiding to {@link #testChecksShouldHaveAllowedAbstractClassAsSuperclass()} rule. +@@ -90,7 +90,7 @@ public class ArchUnitSuperClassTest { + * AbstractJavadocCheck} as their super class. + */ + @Test +- public void testChecksShouldHaveAllowedAbstractClassAsSuperclass() { ++ void checksShouldHaveAllowedAbstractClassAsSuperclass() { + final JavaClasses checksPackage = + new ClassFileImporter() + .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) +@@ -134,7 +134,7 @@ public class ArchUnitSuperClassTest { + public void check(JavaClass item, ConditionEvents events) { + final Optional superclassOptional = item.getSuperclass(); + if (superclassOptional.isPresent()) { +- final JavaClass superclass = superclassOptional.get().toErasure(); ++ final JavaClass superclass = superclassOptional.orElseThrow().toErasure(); + if (!superclass.isEquivalentTo(expectedSuperclass)) { + final String format = "<%s> is subclass of <%s> instead of <%s>"; + final String message = +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitTest.java +index 61b5d3a9f..e659fa755 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ArchUnitTest.java +@@ -32,7 +32,7 @@ import com.tngtech.archunit.lang.EvaluationResult; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class ArchUnitTest { ++final class ArchUnitTest { + + /** + * Suppression list containing violations from {@code classShouldNotDependOnUtilPackages} +@@ -86,7 +86,7 @@ public class ArchUnitTest { + * we need to make checkstyle's Check on this. + */ + @Test +- public void nonProtectedCheckMethodsTest() { ++ void nonProtectedCheckMethodsTest() { + // This list contains methods which have been overridden and are set to ignore in this test. + final String[] methodsWithOverrideAnnotation = { + "processFiltered", +@@ -123,7 +123,7 @@ public class ArchUnitTest { + * Therefore classes in api should not depend on them. + */ + @Test +- public void testClassesInApiDoNotDependOnClassesInUtil() { ++ void classesInApiDoNotDependOnClassesInUtil() { + final JavaClasses apiPackage = + new ClassFileImporter() + .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/CliOptionsXdocsSyncTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CliOptionsXdocsSyncTest.java +index 679765f6f..fd098e685 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/CliOptionsXdocsSyncTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CliOptionsXdocsSyncTest.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; + + import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; +@@ -32,7 +33,6 @@ import java.util.Map; + import java.util.Set; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import org.junit.jupiter.api.Test; + import org.w3c.dom.Document; + import org.w3c.dom.Node; +@@ -40,10 +40,10 @@ import org.w3c.dom.NodeList; + import picocli.CommandLine; + import picocli.CommandLine.Model.OptionSpec; + +-public class CliOptionsXdocsSyncTest { ++final class CliOptionsXdocsSyncTest { + + @Test +- public void validateCliDocSections() throws Exception { ++ void validateCliDocSections() throws Exception { + final Map cmdDesc = new HashMap<>(); + + final NodeList sections = getSectionsFromXdoc("src/xdocs/cmdline.xml.vm"); +@@ -85,7 +85,7 @@ public class CliOptionsXdocsSyncTest { + } + + @Test +- public void validateCliUsageSection() throws Exception { ++ void validateCliUsageSection() throws Exception { + final NodeList sections = getSectionsFromXdoc("src/xdocs/cmdline.xml.vm"); + final Node usageSource = XmlUtil.getFirstChildElement(sections.item(2)); + final String usageText = XmlUtil.getFirstChildElement(usageSource).getTextContent(); +@@ -99,12 +99,12 @@ public class CliOptionsXdocsSyncTest { + final Set shortParamsMain = + commandLine.getCommandSpec().options().stream() + .map(OptionSpec::shortestName) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + final Set longParamsMain = + commandLine.getCommandSpec().options().stream() + .map(OptionSpec::longestName) + .filter(names -> names.length() != 2) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + + assertWithMessage("Short parameters in Main.java and cmdline" + ".xml.vm should match") + .that(shortParamsMain) +@@ -138,7 +138,7 @@ public class CliOptionsXdocsSyncTest { + result = + XmlUtil.getChildrenElements(node).stream() + .map(Node::getTextContent) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + return result; + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java +index 4e0258017..aa53cbbe0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/CommitValidationTest.java +@@ -19,17 +19,18 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableList.toImmutableList; + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.Collections.emptyIterator; + ++import com.google.common.collect.ImmutableList; + import java.io.IOException; +-import java.util.Collections; + import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; + import java.util.Spliterator; + import java.util.Spliterators; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import java.util.stream.StreamSupport; + import org.eclipse.jgit.api.Git; + import org.eclipse.jgit.api.errors.GitAPIException; +@@ -59,10 +60,10 @@ import org.junit.jupiter.api.Test; + * + *

Filtered commit list is checked if their messages has proper structure. + */ +-public class CommitValidationTest { ++final class CommitValidationTest { + + private static final List USERS_EXCLUDED_FROM_VALIDATION = +- Collections.singletonList("dependabot[bot]"); ++ ImmutableList.of("dependabot[bot]"); + + private static final String ISSUE_COMMIT_MESSAGE_REGEX_PATTERN = "^Issue #\\d+: .*$"; + private static final String PR_COMMIT_MESSAGE_REGEX_PATTERN = "^Pull #\\d+: .*$"; +@@ -97,14 +98,14 @@ public class CommitValidationTest { + CommitsResolutionMode.BY_LAST_COMMIT_AUTHOR; + + @Test +- public void testHasCommits() throws Exception { ++ void hasCommits() throws Exception { + final List lastCommits = getCommitsToCheck(); + + assertWithMessage("must have at least one commit to validate").that(lastCommits).isNotEmpty(); + } + + @Test +- public void testCommitMessage() { ++ void commitMessage() { + assertWithMessage("should not accept commit message with periods on end") + .that(validateCommitMessage("minor: Test. Test.")) + .isEqualTo(3); +@@ -146,7 +147,7 @@ public class CommitValidationTest { + } + + @Test +- public void testReleaseCommitMessage() { ++ void releaseCommitMessage() { + assertWithMessage("should accept release commit message for preparing release") + .that( + validateCommitMessage("[maven-release-plugin] " + "prepare release checkstyle-10.8.0")) +@@ -161,7 +162,7 @@ public class CommitValidationTest { + } + + @Test +- public void testRevertCommitMessage() { ++ void revertCommitMessage() { + assertWithMessage("should accept proper revert commit message") + .that( + validateCommitMessage( +@@ -179,7 +180,7 @@ public class CommitValidationTest { + } + + @Test +- public void testSupplementalPrefix() { ++ void supplementalPrefix() { + assertWithMessage("should accept commit message with supplemental prefix") + .that(0) + .isEqualTo( +@@ -209,7 +210,7 @@ public class CommitValidationTest { + } + + @Test +- public void testCommitMessageHasProperStructure() throws Exception { ++ void commitMessageHasProperStructure() throws Exception { + final List lastCommits = getCommitsToCheck(); + for (RevCommit commit : filterValidCommits(lastCommits)) { + final String commitMessage = commit.getFullMessage(); +@@ -295,7 +296,7 @@ public class CommitValidationTest { + second = git.log().add(secondParent).call().iterator(); + } else { + first = git.log().call().iterator(); +- second = Collections.emptyIterator(); ++ second = emptyIterator(); + } + + revCommitIteratorPair = +@@ -317,7 +318,7 @@ public class CommitValidationTest { + Spliterators.spliteratorUnknownSize(previousCommitsIterator, Spliterator.ORDERED); + return StreamSupport.stream(spliterator, false) + .limit(PREVIOUS_COMMITS_TO_CHECK_COUNT) +- .collect(Collectors.toList()); ++ .collect(toImmutableList()); + } + + private static List getCommitsByLastCommitAuthor( +@@ -384,8 +385,8 @@ public class CommitValidationTest { + private final Iterator second; + + private RevCommitsPair() { +- first = Collections.emptyIterator(); +- second = Collections.emptyIterator(); ++ first = emptyIterator(); ++ second = emptyIterator(); + } + + private RevCommitsPair(Iterator first, Iterator second) { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java +index 7545b6af5..acff5163a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/ImmutabilityTest.java +@@ -19,13 +19,16 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableMap.toImmutableMap; + import static com.tngtech.archunit.base.DescribedPredicate.doNot; + import static com.tngtech.archunit.base.DescribedPredicate.not; + import static com.tngtech.archunit.lang.conditions.ArchPredicates.are; + import static com.tngtech.archunit.lang.conditions.ArchPredicates.have; + import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; + import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.fields; ++import static java.util.function.Function.identity; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.FileStatefulCheck; + import com.puppycrawl.tools.checkstyle.GlobalStatefulCheck; + import com.puppycrawl.tools.checkstyle.StatelessCheck; +@@ -51,11 +54,9 @@ import java.util.List; + import java.util.Locale; + import java.util.Map; + import java.util.Set; +-import java.util.function.Function; +-import java.util.stream.Collectors; + import org.junit.jupiter.api.Test; + +-public class ImmutabilityTest { ++final class ImmutabilityTest { + + /** Immutable types canonical names. */ + private static final Set IMMUTABLE_TYPES = +@@ -99,7 +100,7 @@ public class ImmutabilityTest { + + /** List of fields not following {@link #testUtilClassesImmutability()} rule. */ + private static final Set SUPPRESSED_FIELDS_IN_UTIL_CLASSES = +- Set.of( ++ ImmutableSet.of( + "com.puppycrawl.tools.checkstyle.utils.TokenUtil.TOKEN_IDS", + "com.puppycrawl.tools.checkstyle.utils.XpathUtil.TOKEN_TYPES_WITH_TEXT_ATTRIBUTE"); + +@@ -164,7 +165,7 @@ public class ImmutabilityTest { + + /** List of classes not following {@link #testClassesWithMutableFieldsShouldBeStateful()} rule. */ + private static final Set SUPPRESSED_CLASSES_FOR_STATEFUL_CHECK_RULE = +- Set.of("com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"); ++ ImmutableSet.of("com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"); + + private static final JavaClasses CHECKSTYLE_CHECKS = + new ClassFileImporter() +@@ -191,11 +192,11 @@ public class ImmutabilityTest { + /** Map of module full name to module details. */ + private static final Map MODULE_DETAILS_MAP = + XmlMetaReader.readAllModulesIncludingThirdPartyIfAny().stream() +- .collect(Collectors.toMap(ModuleDetails::getFullQualifiedName, Function.identity())); ++ .collect(toImmutableMap(ModuleDetails::getFullQualifiedName, identity())); + + /** Test to ensure that fields in util classes are immutable. */ + @Test +- public void testUtilClassesImmutability() { ++ void utilClassesImmutability() { + final JavaClasses utilClasses = + new ClassFileImporter() + .withImportOption(ImportOption.Predefined.DO_NOT_INCLUDE_TESTS) +@@ -223,7 +224,7 @@ public class ImmutabilityTest { + + /** Test to ensure modules annotated with {@link StatelessCheck} contain immutable fields. */ + @Test +- public void testFieldsInStatelessChecksShouldBeImmutable() { ++ void fieldsInStatelessChecksShouldBeImmutable() { + final DescribedPredicate moduleProperties = new ModulePropertyPredicate(); + + final ArchCondition beSuppressedField = +@@ -245,7 +246,7 @@ public class ImmutabilityTest { + + /** Test to ensure classes with immutable fields are annotated with {@link StatelessCheck}. */ + @Test +- public void testClassesWithImmutableFieldsShouldBeStateless() { ++ void classesWithImmutableFieldsShouldBeStateless() { + final ArchCondition beSuppressedClass = + new SuppressionArchCondition<>( + SUPPRESSED_CLASSES_FOR_STATELESS_CHECK_RULE, "be suppressed"); +@@ -267,7 +268,7 @@ public class ImmutabilityTest { + * {@link GlobalStatefulCheck}. + */ + @Test +- public void testClassesWithMutableFieldsShouldBeStateful() { ++ void classesWithMutableFieldsShouldBeStateful() { + final ArchCondition beSuppressedClass = + new SuppressionArchCondition<>(SUPPRESSED_CLASSES_FOR_STATEFUL_CHECK_RULE, "be suppressed"); + +@@ -350,7 +351,7 @@ public class ImmutabilityTest { + "Field <%s> should %s in %s", + item.getFullName(), + getDescription(), +- item.getSourceCodeLocation().toString()); ++ item.getSourceCodeLocation()); + events.add(SimpleConditionEvent.violated(item, message)); + } + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java +index 41bb12475..649df7737 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsJavaDocsTest.java +@@ -19,7 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.Collections.unmodifiableSet; + + import com.google.common.collect.ImmutableMap; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; +@@ -55,13 +57,11 @@ import java.nio.file.Files; + import java.nio.file.Path; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collections; + import java.util.HashMap; + import java.util.List; + import java.util.Map; + import java.util.Set; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import javax.xml.parsers.ParserConfigurationException; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; +@@ -70,7 +70,7 @@ import org.w3c.dom.NamedNodeMap; + import org.w3c.dom.Node; + import org.w3c.dom.NodeList; + +-public class XdocsJavaDocsTest extends AbstractModuleTestSupport { ++final class XdocsJavaDocsTest extends AbstractModuleTestSupport { + private static final Map> FULLY_QUALIFIED_CLASS_NAMES = + ImmutableMap.>builder() + .put("int", int.class) +@@ -102,7 +102,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { + .build(); + + private static final Set NON_BASE_TOKEN_PROPERTIES = +- Collections.unmodifiableSet( ++ unmodifiableSet( + Arrays.stream( + new String[] { + "AtclauseOrder - target", +@@ -111,7 +111,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { + "MagicNumber - constantWaiverParentToken", + "MultipleStringLiterals - ignoreOccurrenceContext", + }) +- .collect(Collectors.toSet())); ++ .collect(toImmutableSet())); + + private static final List> CHECK_PROPERTIES = new ArrayList<>(); + private static final Map CHECK_PROPERTY_DOC = new HashMap<>(); +@@ -127,7 +127,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { + } + + @BeforeEach +- public void setUp() throws Exception { ++ void setUp() throws Exception { + final DefaultConfiguration checkConfig = + new DefaultConfiguration(JavaDocCapture.class.getName()); + checker = createChecker(checkConfig); +@@ -141,7 +141,7 @@ public class XdocsJavaDocsTest extends AbstractModuleTestSupport { + * method + */ + @Test +- public void testAllCheckSectionJavaDocs() throws Exception { ++ void allCheckSectionJavaDocs() throws Exception { + final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); + + for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsMobileWrapperTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsMobileWrapperTest.java +index 38cf9622c..0aefce94d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsMobileWrapperTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsMobileWrapperTest.java +@@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.internal; + + import static com.google.common.truth.Truth.assertWithMessage; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.internal.utils.XdocUtil; + import com.puppycrawl.tools.checkstyle.internal.utils.XmlUtil; + import java.io.File; +@@ -32,12 +33,12 @@ import org.w3c.dom.Document; + import org.w3c.dom.Node; + import org.w3c.dom.NodeList; + +-public class XdocsMobileWrapperTest { ++final class XdocsMobileWrapperTest { + +- private static final Set NODES_TO_WRAP = Set.of("pre", "table", "svg", "img"); ++ private static final Set NODES_TO_WRAP = ImmutableSet.of("pre", "table", "svg", "img"); + + @Test +- public void testAllCheckSectionMobileWrapper() throws Exception { ++ void allCheckSectionMobileWrapper() throws Exception { + for (Path path : XdocUtil.getXdocsFilePaths()) { + final File file = path.toFile(); + final String fileName = file.getName(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java +index d90a59f16..e018560b7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsPagesTest.java +@@ -19,8 +19,12 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; + import static java.lang.Integer.parseInt; ++import static java.util.Collections.unmodifiableSet; ++import static java.util.regex.Pattern.DOTALL; ++import static java.util.stream.Collectors.joining; + + import com.puppycrawl.tools.checkstyle.Checker; + import com.puppycrawl.tools.checkstyle.ConfigurationLoader; +@@ -54,7 +58,6 @@ import java.util.ArrayList; + import java.util.Arrays; + import java.util.BitSet; + import java.util.Collection; +-import java.util.Collections; + import java.util.HashMap; + import java.util.HashSet; + import java.util.Iterator; +@@ -68,7 +71,6 @@ import java.util.Set; + import java.util.TreeSet; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import java.util.stream.IntStream; + import java.util.stream.Stream; + import org.apache.commons.beanutils.PropertyUtils; +@@ -78,7 +80,7 @@ import org.w3c.dom.Node; + import org.w3c.dom.NodeList; + import org.xml.sax.InputSource; + +-public class XdocsPagesTest { ++final class XdocsPagesTest { + + private static final Path AVAILABLE_CHECKS_PATH = Paths.get("src/xdocs/checks.xml"); + private static final String LINK_TEMPLATE = +@@ -148,7 +150,7 @@ public class XdocsPagesTest { + "MissingDeprecated.skipNoJavadoc"); + + private static final Set SUN_MODULES = +- Collections.unmodifiableSet(CheckUtil.getConfigSunStyleModules()); ++ unmodifiableSet(CheckUtil.getConfigSunStyleModules()); + // ignore the not yet properly covered modules while testing newly added ones + // add proper sections to the coverage report and integration tests + // and then remove this list eventually +@@ -217,10 +219,10 @@ public class XdocsPagesTest { + "WhitespaceAfter", + "WhitespaceAround"); + private static final Set GOOGLE_MODULES = +- Collections.unmodifiableSet(CheckUtil.getConfigGoogleStyleModules()); ++ unmodifiableSet(CheckUtil.getConfigGoogleStyleModules()); + + @Test +- public void testAllChecksPresentOnAvailableChecksPage() throws Exception { ++ void allChecksPresentOnAvailableChecksPage() throws Exception { + final String availableChecks = Files.readString(AVAILABLE_CHECKS_PATH); + + CheckUtil.getSimpleNames(CheckUtil.getCheckstyleChecks()).stream() +@@ -244,8 +246,8 @@ public class XdocsPagesTest { + } + + @Test +- public void testAllChecksPageInSyncWithChecksSummaries() throws Exception { +- final Pattern endOfSentence = Pattern.compile("(.*?\\.)\\s", Pattern.DOTALL); ++ void allChecksPageInSyncWithChecksSummaries() throws Exception { ++ final Pattern endOfSentence = Pattern.compile("(.*?\\.)\\s", DOTALL); + final Map summaries = readSummaries(); + + for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { +@@ -314,7 +316,7 @@ public class XdocsPagesTest { + } + + @Test +- public void testAllSubSections() throws Exception { ++ void allSubSections() throws Exception { + for (Path path : XdocUtil.getXdocsFilePaths()) { + final String input = Files.readString(path); + final String fileName = path.getFileName().toString(); +@@ -363,7 +365,7 @@ public class XdocsPagesTest { + } + + @Test +- public void testAllXmlExamples() throws Exception { ++ void allXmlExamples() throws Exception { + for (Path path : XdocUtil.getXdocsFilePaths()) { + final String input = Files.readString(path); + final String fileName = path.getFileName().toString(); +@@ -485,7 +487,7 @@ public class XdocsPagesTest { + } + + @Test +- public void testAllCheckSections() throws Exception { ++ void allCheckSections() throws Exception { + final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); + + for (Path path : XdocUtil.getXdocsConfigFilePaths(XdocUtil.getXdocsFilePaths())) { +@@ -545,7 +547,7 @@ public class XdocsPagesTest { + * method + */ + @Test +- public void testAllCheckSectionsEx() throws Exception { ++ void allCheckSectionsEx() throws Exception { + final ModuleFactory moduleFactory = TestUtil.getPackageObjectFactory(); + + final Path path = Paths.get(XdocUtil.DIRECTORY_PATH + "/config.xml"); +@@ -1243,7 +1245,7 @@ public class XdocsPagesTest { + final Object[] array = (Object[]) value; + valuesStream = Arrays.stream(array); + } +- result = valuesStream.map(String.class::cast).sorted().collect(Collectors.joining(", ")); ++ result = valuesStream.map(String.class::cast).sorted().collect(joining(", ")); + } + + if (result.isEmpty()) { +@@ -1272,8 +1274,7 @@ public class XdocsPagesTest { + } else { + stream = Arrays.stream((int[]) value); + } +- String result = +- stream.mapToObj(TokenUtil::getTokenName).sorted().collect(Collectors.joining(", ")); ++ String result = stream.mapToObj(TokenUtil::getTokenName).sorted().collect(joining(", ")); + if (result.isEmpty()) { + result = "{}"; + } +@@ -1349,7 +1350,7 @@ public class XdocsPagesTest { + result = + XmlUtil.getChildrenElements(node).stream() + .map(Node::getTextContent) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + return result; + } +@@ -1560,7 +1561,7 @@ public class XdocsPagesTest { + } + + @Test +- public void testAllStyleRules() throws Exception { ++ void allStyleRules() throws Exception { + for (Path path : XdocUtil.getXdocsStyleFilePaths(XdocUtil.getXdocsFilePaths())) { + final String fileName = path.getFileName().toString(); + final String styleName = fileName.substring(0, fileName.lastIndexOf('_')); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsUrlTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsUrlTest.java +index 266786945..4d82a5cb9 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsUrlTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XdocsUrlTest.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; + + import com.puppycrawl.tools.checkstyle.api.AbstractCheck; +@@ -35,14 +36,13 @@ import java.util.List; + import java.util.Locale; + import java.util.Map; + import java.util.Set; +-import java.util.stream.Collectors; + import javax.xml.parsers.SAXParser; + import javax.xml.parsers.SAXParserFactory; + import org.junit.jupiter.api.Test; + import org.xml.sax.Attributes; + import org.xml.sax.helpers.DefaultHandler; + +-public class XdocsUrlTest { ++final class XdocsUrlTest { + + private static final String PACKAGE_NAME = "src/main/java/com/puppycrawl/tools/checkstyle/checks"; + +@@ -74,7 +74,7 @@ public class XdocsUrlTest { + return AbstractCheck.class.isAssignableFrom(clazz) + || AbstractFileSetCheck.class.isAssignableFrom(clazz); + }) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + for (Class check : treeWalkerOrFileSetCheckSet) { + final String checkName = check.getSimpleName(); + if (!TREE_WORKER.equals(checkName)) { +@@ -96,7 +96,7 @@ public class XdocsUrlTest { + } + + @Test +- public void testXdocsUrl() throws Exception { ++ void xdocsUrl() throws Exception { + final SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + final SAXParser parser = parserFactory.newSAXParser(); + final DummyHandler checkHandler = new DummyHandler(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java +index 37041ec97..10b6500c7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/XpathRegressionTest.java +@@ -19,8 +19,13 @@ + + package com.puppycrawl.tools.checkstyle.internal; + ++import static com.google.common.collect.ImmutableMap.toImmutableMap; ++import static com.google.common.collect.ImmutableSet.toImmutableSet; + import static com.google.common.truth.Truth.assertWithMessage; ++import static java.util.function.Function.identity; ++import static java.util.stream.Collectors.toCollection; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.Definitions; + import com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck; +@@ -38,18 +43,16 @@ import java.util.HashSet; + import java.util.Locale; + import java.util.Map; + import java.util.Set; +-import java.util.function.Function; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class XpathRegressionTest extends AbstractModuleTestSupport { ++final class XpathRegressionTest extends AbstractModuleTestSupport { + + // Checks that not compatible with SuppressionXpathFilter + public static final Set INCOMPATIBLE_CHECK_NAMES = +- Set.of( ++ ImmutableSet.of( + "NoCodeInFile (reason is that AST is not generated for a file not containing code)", + "Regexp (reason is at #7759)", + "RegexpSinglelineJava (reason is at #7759)"); +@@ -79,7 +82,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + // Older regex-based checks that are under INCOMPATIBLE_JAVADOC_CHECK_NAMES + // but not subclasses of AbstractJavadocCheck. + private static final Set> REGEXP_JAVADOC_CHECKS = +- Set.of( ++ ImmutableSet.of( + JavadocStyleCheck.class, + JavadocMethodCheck.class, + JavadocTypeCheck.class, +@@ -130,7 +133,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + "VisibilityModifier"); + + // Modules that will never have xpath support ever because they not report violations +- private static final Set NO_VIOLATION_MODULES = Set.of("SuppressWarningsHolder"); ++ private static final Set NO_VIOLATION_MODULES = ImmutableSet.of("SuppressWarningsHolder"); + + private static final Set SIMPLE_CHECK_NAMES = getSimpleCheckNames(); + private static final Map ALLOWED_DIRECTORY_AND_CHECKS = +@@ -151,7 +154,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + + private static Map getAllowedDirectoryAndChecks() { + return SIMPLE_CHECK_NAMES.stream() +- .collect(Collectors.toMap(id -> id.toLowerCase(Locale.ENGLISH), Function.identity())); ++ .collect(toImmutableMap(id -> id.toLowerCase(Locale.ENGLISH), identity())); + } + + private static Set getInternalModules() { +@@ -161,11 +164,11 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + final String[] packageTokens = moduleName.split("\\."); + return packageTokens[packageTokens.length - 1]; + }) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + + @BeforeEach +- public void setUp() throws Exception { ++ void setUp() throws Exception { + javaDir = Paths.get("src/it/java/" + getPackageLocation()); + inputDir = Paths.get(getPath("")); + } +@@ -181,12 +184,12 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + } + + @Test +- public void validateIncompatibleJavadocCheckNames() throws IOException { ++ void validateIncompatibleJavadocCheckNames() throws IOException { + // subclasses of AbstractJavadocCheck + final Set> abstractJavadocCheckNames = + CheckUtil.getCheckstyleChecks().stream() + .filter(AbstractJavadocCheck.class::isAssignableFrom) +- .collect(Collectors.toCollection(HashSet::new)); ++ .collect(toCollection(HashSet::new)); + // add the extra checks + abstractJavadocCheckNames.addAll(REGEXP_JAVADOC_CHECKS); + final Set abstractJavadocCheckSimpleNames = +@@ -200,7 +203,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + } + + @Test +- public void validateIntegrationTestClassNames() throws Exception { ++ void validateIntegrationTestClassNames() throws Exception { + final Set compatibleChecks = new HashSet<>(); + final Pattern pattern = Pattern.compile("^XpathRegression(.+)Test\\.java$"); + try (DirectoryStream javaPaths = Files.newDirectoryStream(javaDir)) { +@@ -244,7 +247,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + final Set allChecks = new HashSet<>(SIMPLE_CHECK_NAMES); + allChecks.removeAll(INCOMPATIBLE_JAVADOC_CHECK_NAMES); + allChecks.removeAll(INCOMPATIBLE_CHECK_NAMES); +- allChecks.removeAll(Set.of("Regexp", "RegexpSinglelineJava", "NoCodeInFile")); ++ allChecks.removeAll(ImmutableSet.of("Regexp", "RegexpSinglelineJava", "NoCodeInFile")); + allChecks.removeAll(MISSING_CHECK_NAMES); + allChecks.removeAll(NO_VIOLATION_MODULES); + allChecks.removeAll(compatibleChecks); +@@ -259,7 +262,7 @@ public class XpathRegressionTest extends AbstractModuleTestSupport { + } + + @Test +- public void validateInputFiles() throws Exception { ++ void validateInputFiles() throws Exception { + try (DirectoryStream dirs = Files.newDirectoryStream(inputDir)) { + for (Path dir : dirs) { + // input directory must be named in lower case +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskLogStub.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskLogStub.java +index df86cea96..9327b8afd 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskLogStub.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskLogStub.java +@@ -19,9 +19,10 @@ + + package com.puppycrawl.tools.checkstyle.internal.testmodules; + ++import static java.util.Collections.unmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + + public final class CheckstyleAntTaskLogStub extends CheckstyleAntTask { +@@ -39,6 +40,6 @@ public final class CheckstyleAntTaskLogStub extends CheckstyleAntTask { + } + + public List getLoggedMessages() { +- return Collections.unmodifiableList(loggedMessages); ++ return unmodifiableList(loggedMessages); + } + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskStub.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskStub.java +index 7cd755ec9..6bfd9706a 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskStub.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/CheckstyleAntTaskStub.java +@@ -19,16 +19,16 @@ + + package com.puppycrawl.tools.checkstyle.internal.testmodules; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask; + import java.io.File; +-import java.util.Collections; + import java.util.List; + + public class CheckstyleAntTaskStub extends CheckstyleAntTask { + + @Override + protected List scanFileSets() { +- return Collections.singletonList(new MockFile()); ++ return ImmutableList.of(new MockFile()); + } + + private static final class MockFile extends File { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/TestRootModuleChecker.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/TestRootModuleChecker.java +index e65561900..3a9012ab4 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/TestRootModuleChecker.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/testmodules/TestRootModuleChecker.java +@@ -19,13 +19,14 @@ + + package com.puppycrawl.tools.checkstyle.internal.testmodules; + ++import static java.util.Collections.unmodifiableList; ++ + import com.puppycrawl.tools.checkstyle.api.AuditListener; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; + import com.puppycrawl.tools.checkstyle.api.Configuration; + import com.puppycrawl.tools.checkstyle.api.RootModule; + import java.io.File; + import java.util.ArrayList; +-import java.util.Collections; + import java.util.List; + + public class TestRootModuleChecker implements RootModule { +@@ -85,7 +86,7 @@ public class TestRootModuleChecker implements RootModule { + } + + public static List getFilesToCheck() { +- return Collections.unmodifiableList(filesToCheck); ++ return unmodifiableList(filesToCheck); + } + + public static Configuration getConfig() { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/CheckUtil.java b/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/CheckUtil.java +index 62c44e451..9c2fcf7ae 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/CheckUtil.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/internal/utils/CheckUtil.java +@@ -19,6 +19,9 @@ + + package com.puppycrawl.tools.checkstyle.internal.utils; + ++import static com.google.common.collect.ImmutableSet.toImmutableSet; ++import static java.util.stream.Collectors.toCollection; ++ + import com.google.common.reflect.ClassPath; + import com.puppycrawl.tools.checkstyle.api.FileText; + import com.puppycrawl.tools.checkstyle.checks.coding.AbstractSuperCheck; +@@ -41,7 +44,6 @@ import java.util.HashSet; + import java.util.Locale; + import java.util.Properties; + import java.util.Set; +-import java.util.stream.Collectors; + import javax.xml.parsers.DocumentBuilder; + import javax.xml.parsers.DocumentBuilderFactory; + import org.w3c.dom.Document; +@@ -86,7 +88,7 @@ public final class CheckUtil { + + return name; + }) +- .collect(Collectors.toCollection(HashSet::new)); ++ .collect(toCollection(HashSet::new)); + } + + /** +@@ -145,7 +147,7 @@ public final class CheckUtil { + final String packageName = "com.puppycrawl.tools.checkstyle"; + return getCheckstyleModulesRecursive(packageName, loader).stream() + .filter(ModuleReflectionUtil::isCheckstyleTreeWalkerCheck) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + + /** +@@ -176,7 +178,7 @@ public final class CheckUtil { + .map(ClassPath.ClassInfo::load) + .filter(ModuleReflectionUtil::isCheckstyleModule) + .filter(CheckUtil::isFromAllowedPackages) +- .collect(Collectors.toSet()); ++ .collect(toImmutableSet()); + } + + /** +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraperTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraperTest.java +index fc18470c2..f01dc1620 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraperTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/meta/JavadocMetadataScraperTest.java +@@ -31,7 +31,7 @@ import java.util.Map; + import java.util.Map.Entry; + import org.junit.jupiter.api.Test; + +-public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { ++final class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +39,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAtclauseOrderCheck() throws Exception { ++ void atclauseOrderCheck() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperAtclauseOrderCheck.java"), +@@ -50,7 +50,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAnnotationUseStyleCheck() throws Exception { ++ void annotationUseStyleCheck() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperAnnotationUseStyleCheck.java"), +@@ -61,7 +61,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testBeforeExecutionExclusionFileFilter() throws Exception { ++ void beforeExecutionExclusionFileFilter() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperBeforeExecutionExclusionFileFilter.java"), +@@ -74,7 +74,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNoCodeInFileCheck() throws Exception { ++ void noCodeInFileCheck() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperNoCodeInFileCheck.java"), +@@ -85,7 +85,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPropertyMisplacedDefaultValueCheck() { ++ void propertyMisplacedDefaultValueCheck() { + JavadocMetadataScraper.resetModuleDetailsStore(); + final CheckstyleException exc = + assertThrows( +@@ -101,7 +101,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPropertyMisplacedTypeCheck() { ++ void propertyMisplacedTypeCheck() { + JavadocMetadataScraper.resetModuleDetailsStore(); + final CheckstyleException exc = + assertThrows( +@@ -118,7 +118,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPropertyMissingDefaultValueCheck() { ++ void propertyMissingDefaultValueCheck() { + JavadocMetadataScraper.resetModuleDetailsStore(); + final CheckstyleException exc = + assertThrows( +@@ -135,7 +135,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPropertyMissingTypeCheck() { ++ void propertyMissingTypeCheck() { + JavadocMetadataScraper.resetModuleDetailsStore(); + final CheckstyleException exc = + assertThrows( +@@ -151,7 +151,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPropertyWithNoCodeTagCheck() throws Exception { ++ void propertyWithNoCodeTagCheck() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperPropertyWithNoCodeTagCheck.java"), +@@ -163,7 +163,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRightCurlyCheck() throws Exception { ++ void rightCurlyCheck() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperRightCurlyCheck.java"), CommonUtil.EMPTY_STRING_ARRAY); +@@ -173,7 +173,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSummaryJavadocCheck() throws Exception { ++ void summaryJavadocCheck() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperSummaryJavadocCheck.java"), +@@ -184,7 +184,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSuppressWarningsFilter() throws Exception { ++ void suppressWarningsFilter() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperSuppressWarningsFilter.java"), +@@ -195,7 +195,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testWriteTagCheck() throws Exception { ++ void writeTagCheck() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + verifyWithInlineConfigParser( + getPath("InputJavadocMetadataScraperWriteTagCheck.java"), CommonUtil.EMPTY_STRING_ARRAY); +@@ -205,7 +205,7 @@ public class JavadocMetadataScraperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmptyDescription() throws Exception { ++ void emptyDescription() throws Exception { + JavadocMetadataScraper.resetModuleDetailsStore(); + + final String[] expected = { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtilTest.java +index ad613e0a4..ce314bfa1 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/meta/MetadataGeneratorUtilTest.java +@@ -21,7 +21,9 @@ package com.puppycrawl.tools.checkstyle.meta; + + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper.MSG_DESC_MISSING; ++import static java.util.stream.Collectors.toCollection; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.internal.utils.CheckUtil; + import java.nio.file.Files; +@@ -32,7 +34,6 @@ import java.util.LinkedHashSet; + import java.util.Set; + import java.util.regex.Matcher; + import java.util.regex.Pattern; +-import java.util.stream.Collectors; + import java.util.stream.Stream; + import org.itsallcode.io.Capturable; + import org.itsallcode.junit.sysextensions.SystemOutGuard; +@@ -40,10 +41,10 @@ import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.extension.ExtendWith; + + @ExtendWith(SystemOutGuard.class) +-public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport { ++final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport { + + private final Set modulesContainingNoMetadataFile = +- Set.of("Checker", "TreeWalker", "JavadocMetadataScraper"); ++ ImmutableSet.of("Checker", "TreeWalker", "JavadocMetadataScraper"); + + @Override + protected String getPackageLocation() { +@@ -63,7 +64,7 @@ public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport { + * System.out} for error messages + */ + @Test +- public void testMetadataFilesGenerationAllFiles(@SystemOutGuard.SysOut Capturable systemOut) ++ void metadataFilesGenerationAllFiles(@SystemOutGuard.SysOut Capturable systemOut) + throws Exception { + systemOut.captureMuted(); + +@@ -113,12 +114,12 @@ public final class MetadataGeneratorUtilTest extends AbstractModuleTestSupport { + .filter(path -> !path.toString().endsWith(".properties")) + .map(MetadataGeneratorUtilTest::getMetaFileName) + .sorted() +- .collect(Collectors.toCollection(LinkedHashSet::new)); ++ .collect(toCollection(LinkedHashSet::new)); + } + final Set checkstyleModules = + CheckUtil.getSimpleNames(CheckUtil.getCheckstyleModules()).stream() + .sorted() +- .collect(Collectors.toCollection(LinkedHashSet::new)); ++ .collect(toCollection(LinkedHashSet::new)); + checkstyleModules.removeAll(modulesContainingNoMetadataFile); + assertWithMessage( + "Number of generated metadata files dont match with " + "number of checkstyle module") +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/meta/XmlMetaReaderTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/meta/XmlMetaReaderTest.java +index b90dcbd2d..00526dba7 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/meta/XmlMetaReaderTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/meta/XmlMetaReaderTest.java +@@ -29,7 +29,7 @@ import java.util.List; + import org.apache.commons.io.IOUtils; + import org.junit.jupiter.api.Test; + +-public class XmlMetaReaderTest extends AbstractPathTestSupport { ++final class XmlMetaReaderTest extends AbstractPathTestSupport { + + @Override + protected String getPackageLocation() { +@@ -37,12 +37,12 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { + } + + @Test +- public void test() { ++ void test() { + assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny()).hasSize(199); + } + + @Test +- public void testDuplicatePackage() { ++ void duplicatePackage() { + assertThat( + XmlMetaReader.readAllModulesIncludingThirdPartyIfAny( + "com.puppycrawl.tools.checkstyle.meta")) +@@ -50,12 +50,12 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testBadPackage() { ++ void badPackage() { + assertThat(XmlMetaReader.readAllModulesIncludingThirdPartyIfAny("DOES.NOT.EXIST")).hasSize(199); + } + + @Test +- public void testReadXmlMetaCheckWithProperties() throws Exception { ++ void readXmlMetaCheckWithProperties() throws Exception { + final String path = getPath("InputXmlMetaReaderCheckWithProps.xml"); + try (InputStream is = Files.newInputStream(Paths.get(path))) { + final ModuleDetails result = XmlMetaReader.read(is, ModuleType.CHECK); +@@ -87,7 +87,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReadXmlMetaCheckNoProperties() throws Exception { ++ void readXmlMetaCheckNoProperties() throws Exception { + final String path = getPath("InputXmlMetaReaderCheckNoProps.xml"); + try (InputStream is = Files.newInputStream(Paths.get(path))) { + final ModuleDetails result = XmlMetaReader.read(is, ModuleType.CHECK); +@@ -107,7 +107,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReadXmlMetaFilter() throws Exception { ++ void readXmlMetaFilter() throws Exception { + final String path = getPath("InputXmlMetaReaderFilter.xml"); + try (InputStream is = Files.newInputStream(Paths.get(path))) { + final ModuleDetails result = XmlMetaReader.read(is, ModuleType.FILTER); +@@ -133,7 +133,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReadXmlMetaFileFilter() throws Exception { ++ void readXmlMetaFileFilter() throws Exception { + final String path = getPath("InputXmlMetaReaderFileFilter.xml"); + try (InputStream is = Files.newInputStream(Paths.get(path))) { + final ModuleDetails result = XmlMetaReader.read(is, ModuleType.FILEFILTER); +@@ -158,7 +158,7 @@ public class XmlMetaReaderTest extends AbstractPathTestSupport { + } + + @Test +- public void testReadXmlMetaModuleTypeNull() throws Exception { ++ void readXmlMetaModuleTypeNull() throws Exception { + try (InputStream is = IOUtils.toInputStream("", "UTF-8")) { + assertThat(XmlMetaReader.read(is, null)).isNull(); + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilTest.java +index a285623d8..4ada671de 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/AnnotationUtilTest.java +@@ -22,16 +22,17 @@ package com.puppycrawl.tools.checkstyle.utils; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; + ++import com.google.common.collect.ImmutableSet; + import com.puppycrawl.tools.checkstyle.DetailAstImpl; + import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class AnnotationUtilTest { ++final class AnnotationUtilTest { + + @Test +- public void testIsProperUtilsClass() { ++ void isProperUtilsClass() { + try { + isUtilsClassHasPrivateConstructor(AnnotationUtil.class); + assertWithMessage("Exception is expected").fail(); +@@ -45,7 +46,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationNull() { ++ void containsAnnotationNull() { + try { + AnnotationUtil.containsAnnotation(null); + assertWithMessage("IllegalArgumentException is expected").fail(); +@@ -57,7 +58,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationNull2() { ++ void containsAnnotationNull2() { + try { + AnnotationUtil.containsAnnotation(null, ""); + assertWithMessage("IllegalArgumentException is expected").fail(); +@@ -69,7 +70,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationFalse() { ++ void containsAnnotationFalse() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(1); + assertWithMessage("AnnotationUtil should not contain " + ast) +@@ -78,7 +79,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationFalse2() { ++ void containsAnnotationFalse2() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(1); + final DetailAstImpl ast2 = new DetailAstImpl(); +@@ -90,7 +91,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationTrue() { ++ void containsAnnotationTrue() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(1); + final DetailAstImpl ast2 = new DetailAstImpl(); +@@ -105,7 +106,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testAnnotationHolderNull() { ++ void annotationHolderNull() { + try { + AnnotationUtil.getAnnotationHolder(null); + assertWithMessage("IllegalArgumentException is expected").fail(); +@@ -117,7 +118,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testAnnotationNull() { ++ void annotationNull() { + try { + AnnotationUtil.getAnnotation(null, null); + assertWithMessage("IllegalArgumentException is expected").fail(); +@@ -129,7 +130,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testAnnotationNull2() { ++ void annotationNull2() { + try { + AnnotationUtil.getAnnotation(new DetailAstImpl(), null); + assertWithMessage("IllegalArgumentException is expected").fail(); +@@ -141,7 +142,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testAnnotationEmpty() { ++ void annotationEmpty() { + try { + AnnotationUtil.getAnnotation(new DetailAstImpl(), ""); + assertWithMessage("IllegalArgumentException is expected").fail(); +@@ -153,7 +154,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationWithNull() { ++ void containsAnnotationWithNull() { + try { + AnnotationUtil.getAnnotation(null, ""); + assertWithMessage("IllegalArgumentException is expected").fail(); +@@ -165,9 +166,9 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationListWithNullAst() { ++ void containsAnnotationListWithNullAst() { + try { +- AnnotationUtil.containsAnnotation(null, Set.of("Override")); ++ AnnotationUtil.containsAnnotation(null, ImmutableSet.of("Override")); + assertWithMessage("IllegalArgumentException is expected").fail(); + } catch (IllegalArgumentException ex) { + assertWithMessage("Invalid exception message") +@@ -177,7 +178,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationListWithNullList() { ++ void containsAnnotationListWithNullList() { + final DetailAST ast = new DetailAstImpl(); + final Set annotations = null; + try { +@@ -191,26 +192,26 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationListWithEmptyList() { ++ void containsAnnotationListWithEmptyList() { + final DetailAST ast = new DetailAstImpl(); +- final Set annotations = Set.of(); ++ final Set annotations = ImmutableSet.of(); + final boolean result = AnnotationUtil.containsAnnotation(ast, annotations); + assertWithMessage("An empty set should lead to a false result").that(result).isFalse(); + } + + @Test +- public void testContainsAnnotationListWithNoAnnotationNode() { ++ void containsAnnotationListWithNoAnnotationNode() { + final DetailAstImpl ast = new DetailAstImpl(); + final DetailAstImpl modifiersAst = new DetailAstImpl(); + modifiersAst.setType(TokenTypes.MODIFIERS); + ast.addChild(modifiersAst); +- final Set annotations = Set.of("Override"); ++ final Set annotations = ImmutableSet.of("Override"); + final boolean result = AnnotationUtil.containsAnnotation(ast, annotations); + assertWithMessage("An empty ast should lead to a false result").that(result).isFalse(); + } + + @Test +- public void testContainsAnnotationListWithNoMatchingAnnotation() { ++ void containsAnnotationListWithNoMatchingAnnotation() { + final DetailAstImpl ast = new DetailAstImpl(); + final DetailAstImpl modifiersAst = + create( +@@ -219,13 +220,13 @@ public class AnnotationUtilTest { + TokenTypes.ANNOTATION, + create(TokenTypes.DOT, create(TokenTypes.IDENT, "Override")))); + ast.addChild(modifiersAst); +- final Set annotations = Set.of("Deprecated"); ++ final Set annotations = ImmutableSet.of("Deprecated"); + final boolean result = AnnotationUtil.containsAnnotation(ast, annotations); + assertWithMessage("No matching annotation found").that(result).isFalse(); + } + + @Test +- public void testContainsAnnotation() { ++ void containsAnnotation() { + final DetailAstImpl astForTest = new DetailAstImpl(); + astForTest.setType(TokenTypes.PACKAGE_DEF); + final DetailAstImpl child = new DetailAstImpl(); +@@ -250,7 +251,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationWithStringFalse() { ++ void containsAnnotationWithStringFalse() { + final DetailAstImpl astForTest = new DetailAstImpl(); + astForTest.setType(TokenTypes.PACKAGE_DEF); + final DetailAstImpl child = new DetailAstImpl(); +@@ -275,7 +276,7 @@ public class AnnotationUtilTest { + } + + @Test +- public void testContainsAnnotationWithComment() { ++ void containsAnnotationWithComment() { + final DetailAstImpl astForTest = new DetailAstImpl(); + astForTest.setType(TokenTypes.PACKAGE_DEF); + final DetailAstImpl child = new DetailAstImpl(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPositionTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPositionTest.java +index 5267d9c48..65ab53258 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPositionTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/BlockCommentPositionTest.java +@@ -19,6 +19,7 @@ + + package com.puppycrawl.tools.checkstyle.utils; + ++import static com.google.common.base.Preconditions.checkState; + import static com.google.common.truth.Truth.assertWithMessage; + + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; +@@ -32,17 +33,17 @@ import java.util.List; + import java.util.function.Function; + import org.junit.jupiter.api.Test; + +-public class BlockCommentPositionTest extends AbstractModuleTestSupport { ++final class BlockCommentPositionTest extends AbstractModuleTestSupport { + + @Test +- public void testPrivateConstr() throws Exception { ++ void privateConstr() throws Exception { + assertWithMessage("Constructor is not private") + .that(TestUtil.isUtilsClassHasPrivateConstructor(BlockCommentPosition.class)) + .isTrue(); + } + + @Test +- public void testJavaDocsRecognition() throws Exception { ++ void javaDocsRecognition() throws Exception { + final List metadataList = + Arrays.asList( + new BlockCommentPositionTestMetadata( +@@ -88,7 +89,7 @@ public class BlockCommentPositionTest extends AbstractModuleTestSupport { + } + + @Test +- public void testJavaDocsRecognitionNonCompilable() throws Exception { ++ void javaDocsRecognitionNonCompilable() throws Exception { + final List metadataList = + Arrays.asList( + new BlockCommentPositionTestMetadata( +@@ -113,9 +114,7 @@ public class BlockCommentPositionTest extends AbstractModuleTestSupport { + DetailAST node = detailAST; + while (node != null) { + if (node.getType() == TokenTypes.BLOCK_COMMENT_BEGIN && JavadocUtil.isJavadocComment(node)) { +- if (!assertion.apply(node)) { +- throw new IllegalStateException("Position of comment is defined correctly"); +- } ++ checkState(assertion.apply(node), "Position of comment is defined correctly"); + matchFound++; + } + matchFound += getJavadocsCount(node.getFirstChild(), assertion); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ChainedPropertyUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ChainedPropertyUtilTest.java +index 8dd8dde45..9f6d6b298 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ChainedPropertyUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ChainedPropertyUtilTest.java +@@ -33,7 +33,7 @@ import java.nio.file.Files; + import java.util.Properties; + import org.junit.jupiter.api.Test; + +-public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { ++final class ChainedPropertyUtilTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -41,14 +41,14 @@ public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private.") + .that(isUtilsClassHasPrivateConstructor(ChainedPropertyUtil.class)) + .isTrue(); + } + + @Test +- public void testPropertyChaining() throws Exception { ++ void propertyChaining() throws Exception { + final File propertiesFile = new File(getPath("InputChainedPropertyUtil.properties")); + final Properties properties = loadProperties(propertiesFile); + final Properties resolvedProperties = ChainedPropertyUtil.getResolvedProperties(properties); +@@ -72,7 +72,7 @@ public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPropertyChainingPropertyNotFound() throws Exception { ++ void propertyChainingPropertyNotFound() throws Exception { + final File propertiesFile = + new File(getPath("InputChainedPropertyUtilUndefinedProperty.properties")); + final Properties properties = loadProperties(propertiesFile); +@@ -87,7 +87,7 @@ public class ChainedPropertyUtilTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPropertyChainingRecursiveUnresolvable() throws Exception { ++ void propertyChainingRecursiveUnresolvable() throws Exception { + final File propertiesFile = + new File(getPath("InputChainedPropertyUtilRecursiveUnresolvable.properties")); + final Properties properties = loadProperties(propertiesFile); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilTest.java +index b28276d60..60407fbcb 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CheckUtilTest.java +@@ -37,7 +37,7 @@ import java.util.Optional; + import java.util.Set; + import org.junit.jupiter.api.Test; + +-public class CheckUtilTest extends AbstractPathTestSupport { ++final class CheckUtilTest extends AbstractPathTestSupport { + + @Override + protected String getPackageLocation() { +@@ -45,20 +45,20 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(CheckUtil.class)) + .isTrue(); + } + + @Test +- public void testParseDoubleWithIncorrectToken() { ++ void parseDoubleWithIncorrectToken() { + final double parsedDouble = CheckUtil.parseDouble("1_02", TokenTypes.ASSIGN); + assertWithMessage("Invalid parse result").that(parsedDouble).isEqualTo(Double.NaN); + } + + @Test +- public void testElseWithCurly() { ++ void elseWithCurly() { + final DetailAstImpl ast = new DetailAstImpl(); + ast.setType(TokenTypes.ASSIGN); + ast.setText("ASSIGN"); +@@ -97,7 +97,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testEquals() { ++ void testEquals() { + final DetailAstImpl litStatic = new DetailAstImpl(); + litStatic.setType(TokenTypes.LITERAL_STATIC); + +@@ -141,7 +141,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetAccessModifierFromModifiersTokenWrongTokenType() { ++ void getAccessModifierFromModifiersTokenWrongTokenType() { + final DetailAstImpl modifiers = new DetailAstImpl(); + modifiers.setType(TokenTypes.METHOD_DEF); + +@@ -158,7 +158,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetTypeParameterNames() throws Exception { ++ void getTypeParameterNames() throws Exception { + final DetailAST parameterizedClassNode = getNodeFromFile(TokenTypes.CLASS_DEF); + final List expected = Arrays.asList("V", "C"); + final List actual = CheckUtil.getTypeParameterNames(parameterizedClassNode); +@@ -167,7 +167,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetTypeParameters() throws Exception { ++ void getTypeParameters() throws Exception { + final DetailAST parameterizedClassNode = getNodeFromFile(TokenTypes.CLASS_DEF); + final DetailAST firstTypeParameter = getNode(parameterizedClassNode, TokenTypes.TYPE_PARAMETER); + final List expected = +@@ -178,7 +178,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsEqualsMethod() throws Exception { ++ void isEqualsMethod() throws Exception { + final DetailAST equalsMethodNode = getNodeFromFile(TokenTypes.METHOD_DEF); + final DetailAST someOtherMethod = equalsMethodNode.getNextSibling(); + +@@ -191,7 +191,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsElseIf() throws Exception { ++ void isElseIf() throws Exception { + final DetailAST targetMethodNode = getNodeFromFile(TokenTypes.METHOD_DEF).getNextSibling(); + final DetailAST firstElseNode = getNode(targetMethodNode, TokenTypes.LITERAL_ELSE); + final DetailAST ifElseWithCurlyBraces = firstElseNode.getFirstChild().getFirstChild(); +@@ -212,7 +212,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsNonVoidMethod() throws Exception { ++ void isNonVoidMethod() throws Exception { + final DetailAST nonVoidMethod = getNodeFromFile(TokenTypes.METHOD_DEF); + final DetailAST voidMethod = nonVoidMethod.getNextSibling(); + +@@ -225,7 +225,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsGetterMethod() throws Exception { ++ void isGetterMethod() throws Exception { + final DetailAST notGetterMethod = getNodeFromFile(TokenTypes.METHOD_DEF); + final DetailAST getterMethod = notGetterMethod.getNextSibling().getNextSibling(); + +@@ -238,7 +238,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsSetterMethod() throws Exception { ++ void isSetterMethod() throws Exception { + final DetailAST firstClassMethod = getNodeFromFile(TokenTypes.METHOD_DEF); + final DetailAST setterMethod = + firstClassMethod.getNextSibling().getNextSibling().getNextSibling(); +@@ -253,7 +253,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetAccessModifierFromModifiersToken() throws Exception { ++ void getAccessModifierFromModifiersToken() throws Exception { + final DetailAST interfaceDef = getNodeFromFile(TokenTypes.INTERFACE_DEF); + final AccessModifierOption modifierInterface = + CheckUtil.getAccessModifierFromModifiersToken( +@@ -292,7 +292,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetFirstNode() throws Exception { ++ void getFirstNode() throws Exception { + final DetailAST classDef = getNodeFromFile(TokenTypes.CLASS_DEF); + + final DetailAST firstChild = classDef.getFirstChild().getFirstChild(); +@@ -301,7 +301,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetFirstNode1() { ++ void getFirstNode1() { + final DetailAstImpl child = new DetailAstImpl(); + child.setLineNo(5); + child.setColumnNo(6); +@@ -317,7 +317,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetFirstNode2() { ++ void getFirstNode2() { + final DetailAstImpl child = new DetailAstImpl(); + child.setLineNo(6); + child.setColumnNo(5); +@@ -333,7 +333,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsReceiverParameter() throws Exception { ++ void isReceiverParameter() throws Exception { + final DetailAST objBlock = getNodeFromFile(TokenTypes.OBJBLOCK); + final DetailAST methodWithReceiverParameter = + objBlock.getLastChild().getPreviousSibling().getPreviousSibling(); +@@ -350,7 +350,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testParseDoubleFloatingPointValues() { ++ void parseDoubleFloatingPointValues() { + assertWithMessage("Invalid parse result") + .that(CheckUtil.parseDouble("-0.05f", TokenTypes.NUM_FLOAT)) + .isEqualTo(-0.05); +@@ -372,7 +372,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testParseDoubleIntegerValues() { ++ void parseDoubleIntegerValues() { + assertWithMessage("Invalid parse result") + .that(CheckUtil.parseDouble("0L", TokenTypes.NUM_LONG)) + .isEqualTo(0.0); +@@ -409,7 +409,7 @@ public class CheckUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testParseClassNames() { ++ void parseClassNames() { + final Set actual = + CheckUtil.parseClassNames("I.am.class.name.with.dot.in.the.end.", "ClassOnly", "my.Class"); + final Set expected = new HashSet<>(); +@@ -434,6 +434,6 @@ public class CheckUtilTest extends AbstractPathTestSupport { + .that(node.isPresent()) + .isTrue(); + +- return node.get(); ++ return node.orElseThrow(); + } + } +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/CodePointUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CodePointUtilTest.java +index b243dabef..d132cb7b5 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/CodePointUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CodePointUtilTest.java +@@ -24,10 +24,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsCla + + import org.junit.jupiter.api.Test; + +-public class CodePointUtilTest { ++final class CodePointUtilTest { + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(CodePointUtil.class)) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilTest.java +index 90710ff59..6f2f1fc8b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/CommonUtilTest.java +@@ -22,6 +22,8 @@ package com.puppycrawl.tools.checkstyle.utils; + import static com.google.common.truth.Truth.assertThat; + import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; ++import static java.nio.charset.StandardCharsets.UTF_8; ++import static java.util.regex.Pattern.MULTILINE; + import static org.junit.jupiter.api.Assertions.assertThrows; + import static org.mockito.Mockito.CALLS_REAL_METHODS; + import static org.mockito.Mockito.mock; +@@ -40,7 +42,6 @@ import java.lang.reflect.Constructor; + import java.net.URI; + import java.net.URISyntaxException; + import java.net.URL; +-import java.nio.charset.StandardCharsets; + import java.util.Dictionary; + import java.util.Properties; + import java.util.regex.Pattern; +@@ -48,7 +49,7 @@ import org.apache.commons.io.IOUtils; + import org.junit.jupiter.api.Test; + import org.mockito.MockedStatic; + +-public class CommonUtilTest extends AbstractPathTestSupport { ++final class CommonUtilTest extends AbstractPathTestSupport { + + /** After appending to path produces equivalent, but denormalized path. */ + private static final String PATH_DENORMALIZER = "/levelDown/.././"; +@@ -59,7 +60,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(CommonUtil.class)) + .isTrue(); +@@ -67,7 +68,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + + /** Test CommonUtil.countCharInString. */ + @Test +- public void testLengthExpandedTabs() { ++ void lengthExpandedTabs() { + final String s1 = "\t"; + assertWithMessage("Invalid expanded tabs length") + .that(CommonUtil.lengthExpandedTabs(s1, s1.length(), 8)) +@@ -103,7 +104,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testCreatePattern() { ++ void createPattern() { + assertWithMessage("invalid pattern") + .that(CommonUtil.createPattern("Test").pattern()) + .isEqualTo("Test"); +@@ -113,7 +114,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testBadRegex() { ++ void badRegex() { + final IllegalArgumentException ex = + assertThrows( + IllegalArgumentException.class, +@@ -127,12 +128,12 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testBadRegex2() { ++ void badRegex2() { + final IllegalArgumentException ex = + assertThrows( + IllegalArgumentException.class, + () -> { +- CommonUtil.createPattern("[", Pattern.MULTILINE); ++ CommonUtil.createPattern("[", MULTILINE); + }); + assertWithMessage("Invalid exception message") + .that(ex) +@@ -141,7 +142,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testFileExtensions() { ++ void fileExtensions() { + final String[] fileExtensions = {"java"}; + final File pdfFile = new File("file.pdf"); + assertWithMessage("Invalid file extension") +@@ -170,42 +171,42 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testHasWhitespaceBefore() { ++ void hasWhitespaceBefore() { + assertWithMessage("Invalid result").that(CommonUtil.hasWhitespaceBefore(0, "a")).isTrue(); + assertWithMessage("Invalid result").that(CommonUtil.hasWhitespaceBefore(4, " a")).isTrue(); + assertWithMessage("Invalid result").that(CommonUtil.hasWhitespaceBefore(5, " a")).isFalse(); + } + + @Test +- public void testBaseClassNameForCanonicalName() { ++ void baseClassNameForCanonicalName() { + assertWithMessage("Invalid base class name") + .that(CommonUtil.baseClassName("java.util.List")) + .isEqualTo("List"); + } + + @Test +- public void testBaseClassNameForSimpleName() { ++ void baseClassNameForSimpleName() { + assertWithMessage("Invalid base class name") + .that(CommonUtil.baseClassName("Set")) + .isEqualTo("Set"); + } + + @Test +- public void testRelativeNormalizedPath() { ++ void relativeNormalizedPath() { + final String relativePath = CommonUtil.relativizeAndNormalizePath("/home", "/home/test"); + + assertWithMessage("Invalid relative path").that(relativePath).isEqualTo("test"); + } + + @Test +- public void testRelativeNormalizedPathWithNullBaseDirectory() { ++ void relativeNormalizedPathWithNullBaseDirectory() { + final String relativePath = CommonUtil.relativizeAndNormalizePath(null, "/tmp"); + + assertWithMessage("Invalid relative path").that(relativePath).isEqualTo("/tmp"); + } + + @Test +- public void testRelativeNormalizedPathWithDenormalizedBaseDirectory() throws IOException { ++ void relativeNormalizedPathWithDenormalizedBaseDirectory() throws IOException { + final String sampleAbsolutePath = new File("src/main/java").getCanonicalPath(); + final String absoluteFilePath = sampleAbsolutePath + "/SampleFile.java"; + final String basePath = sampleAbsolutePath + PATH_DENORMALIZER; +@@ -216,19 +217,19 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testPattern() { ++ void pattern() { + final boolean result = CommonUtil.isPatternValid("someValidPattern"); + assertWithMessage("Should return true when pattern is valid").that(result).isTrue(); + } + + @Test +- public void testInvalidPattern() { ++ void invalidPattern() { + final boolean result = CommonUtil.isPatternValid("some[invalidPattern"); + assertWithMessage("Should return false when pattern is invalid").that(result).isFalse(); + } + + @Test +- public void testGetExistingConstructor() throws NoSuchMethodException { ++ void getExistingConstructor() throws NoSuchMethodException { + final Constructor constructor = CommonUtil.getConstructor(String.class, String.class); + + assertWithMessage("Invalid constructor") +@@ -237,7 +238,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetNonExistentConstructor() { ++ void getNonExistentConstructor() { + final IllegalStateException ex = + assertThrows( + IllegalStateException.class, +@@ -251,7 +252,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testInvokeConstructor() throws NoSuchMethodException { ++ void invokeConstructor() throws NoSuchMethodException { + final Constructor constructor = String.class.getConstructor(String.class); + + final String constructedString = CommonUtil.invokeConstructor(constructor, "string"); +@@ -261,7 +262,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + + @SuppressWarnings("rawtypes") + @Test +- public void testInvokeConstructorThatFails() throws NoSuchMethodException { ++ void invokeConstructorThatFails() throws NoSuchMethodException { + final Constructor constructor = Dictionary.class.getConstructor(); + final IllegalStateException ex = + assertThrows( +@@ -276,7 +277,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testClose() { ++ void close() { + final TestCloseable closeable = new TestCloseable(); + + CommonUtil.close(null); +@@ -286,7 +287,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testCloseWithException() { ++ void closeWithException() { + final IllegalStateException ex = + assertThrows( + IllegalStateException.class, +@@ -303,7 +304,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testFillTemplateWithStringsByRegexp() { ++ void fillTemplateWithStringsByRegexp() { + assertWithMessage("invalid result") + .that( + CommonUtil.fillTemplateWithStringsByRegexp( +@@ -324,7 +325,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetFileNameWithoutExtension() { ++ void getFileNameWithoutExtension() { + assertWithMessage("invalid result") + .that(CommonUtil.getFileNameWithoutExtension("filename")) + .isEqualTo("filename"); +@@ -337,7 +338,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetFileExtension() { ++ void getFileExtension() { + assertWithMessage("Invalid extension") + .that(CommonUtil.getFileExtension("filename")) + .isEqualTo(""); +@@ -350,154 +351,154 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsIdentifier() { ++ void isIdentifier() { + assertWithMessage("Should return true when valid identifier is passed") + .that(CommonUtil.isIdentifier("aValidIdentifier")) + .isTrue(); + } + + @Test +- public void testIsIdentifierEmptyString() { ++ void isIdentifierEmptyString() { + assertWithMessage("Should return false when empty string is passed") + .that(CommonUtil.isIdentifier("")) + .isFalse(); + } + + @Test +- public void testIsIdentifierInvalidFirstSymbol() { ++ void isIdentifierInvalidFirstSymbol() { + assertWithMessage("Should return false when invalid identifier is passed") + .that(CommonUtil.isIdentifier("1InvalidIdentifier")) + .isFalse(); + } + + @Test +- public void testIsIdentifierInvalidSymbols() { ++ void isIdentifierInvalidSymbols() { + assertWithMessage("Should return false when invalid identifier is passed") + .that(CommonUtil.isIdentifier("invalid#Identifier")) + .isFalse(); + } + + @Test +- public void testIsName() { ++ void isName() { + assertWithMessage("Should return true when valid name is passed") + .that(CommonUtil.isName("a.valid.Nam3")) + .isTrue(); + } + + @Test +- public void testIsNameEmptyString() { ++ void isNameEmptyString() { + assertWithMessage("Should return false when empty string is passed") + .that(CommonUtil.isName("")) + .isFalse(); + } + + @Test +- public void testIsNameInvalidFirstSymbol() { ++ void isNameInvalidFirstSymbol() { + assertWithMessage("Should return false when invalid name is passed") + .that(CommonUtil.isName("1.invalid.name")) + .isFalse(); + } + + @Test +- public void testIsNameEmptyPart() { ++ void isNameEmptyPart() { + assertWithMessage("Should return false when name has empty part") + .that(CommonUtil.isName("invalid..name")) + .isFalse(); + } + + @Test +- public void testIsNameEmptyLastPart() { ++ void isNameEmptyLastPart() { + assertWithMessage("Should return false when name has empty part") + .that(CommonUtil.isName("invalid.name.")) + .isFalse(); + } + + @Test +- public void testIsNameInvalidSymbol() { ++ void isNameInvalidSymbol() { + assertWithMessage("Should return false when invalid name is passed") + .that(CommonUtil.isName("invalid.name#42")) + .isFalse(); + } + + @Test +- public void testIsBlank() { ++ void isBlank() { + assertWithMessage("Should return false when string is not empty") + .that(CommonUtil.isBlank("string")) + .isFalse(); + } + + @Test +- public void testIsBlankAheadWhitespace() { ++ void isBlankAheadWhitespace() { + assertWithMessage("Should return false when string is not empty") + .that(CommonUtil.isBlank(" string")) + .isFalse(); + } + + @Test +- public void testIsBlankBehindWhitespace() { ++ void isBlankBehindWhitespace() { + assertWithMessage("Should return false when string is not empty") + .that(CommonUtil.isBlank("string ")) + .isFalse(); + } + + @Test +- public void testIsBlankWithWhitespacesAround() { ++ void isBlankWithWhitespacesAround() { + assertWithMessage("Should return false when string is not empty") + .that(CommonUtil.isBlank(" string ")) + .isFalse(); + } + + @Test +- public void testIsBlankWhitespaceInside() { ++ void isBlankWhitespaceInside() { + assertWithMessage("Should return false when string is not empty") + .that(CommonUtil.isBlank("str ing")) + .isFalse(); + } + + @Test +- public void testIsBlankNullString() { ++ void isBlankNullString() { + assertWithMessage("Should return true when string is null") + .that(CommonUtil.isBlank(null)) + .isTrue(); + } + + @Test +- public void testIsBlankWithEmptyString() { ++ void isBlankWithEmptyString() { + assertWithMessage("Should return true when string is empty") + .that(CommonUtil.isBlank("")) + .isTrue(); + } + + @Test +- public void testIsBlankWithWhitespacesOnly() { ++ void isBlankWithWhitespacesOnly() { + assertWithMessage("Should return true when string contains only spaces") + .that(CommonUtil.isBlank(" ")) + .isTrue(); + } + + @Test +- public void testIsIntValidString() { ++ void isIntValidString() { + assertWithMessage("Should return true when string is null") + .that(CommonUtil.isInt("42")) + .isTrue(); + } + + @Test +- public void testIsIntInvalidString() { ++ void isIntInvalidString() { + assertWithMessage("Should return false when object passed is not integer") + .that(CommonUtil.isInt("foo")) + .isFalse(); + } + + @Test +- public void testIsIntNull() { ++ void isIntNull() { + assertWithMessage("Should return false when null is passed") + .that(CommonUtil.isInt(null)) + .isFalse(); + } + + @Test +- public void testGetUriByFilenameFindsAbsoluteResourceOnClasspath() throws Exception { ++ void getUriByFilenameFindsAbsoluteResourceOnClasspath() throws Exception { + final String filename = "/" + getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; + final URI uri = CommonUtil.getUriByFilename(filename); + +@@ -508,7 +509,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetUriByFilenameFindsRelativeResourceOnClasspath() throws Exception { ++ void getUriByFilenameFindsRelativeResourceOnClasspath() throws Exception { + final String filename = getPackageLocation() + "/InputCommonUtilTest_empty_checks.xml"; + final URI uri = CommonUtil.getUriByFilename(filename); + +@@ -524,7 +525,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + * interpreted relative to the current package "com/puppycrawl/tools/checkstyle/utils/" + */ + @Test +- public void testGetUriByFilenameFindsResourceRelativeToRootClasspath() throws Exception { ++ void getUriByFilenameFindsResourceRelativeToRootClasspath() throws Exception { + final String filename = getPackageLocation() + "/InputCommonUtilTest_resource.txt"; + final URI uri = CommonUtil.getUriByFilename(filename); + assertWithMessage("URI is null for: " + filename).that(uri).isNotNull(); +@@ -535,12 +536,12 @@ public class CommonUtilTest extends AbstractPathTestSupport { + assertWithMessage("URI is relative to package " + uriRelativeToPackage) + .that(uri.toString()) + .doesNotContain(uriRelativeToPackage); +- final String content = IOUtils.toString(uri.toURL(), StandardCharsets.UTF_8); ++ final String content = IOUtils.toString(uri.toURL(), UTF_8); + assertWithMessage("Content mismatches for: " + uri).that(content).startsWith("good"); + } + + @Test +- public void testGetUriByFilenameClasspathPrefixLoadConfig() throws Exception { ++ void getUriByFilenameClasspathPrefixLoadConfig() throws Exception { + final String filename = + CommonUtil.CLASSPATH_URL_PROTOCOL + + getPackageLocation() +@@ -554,7 +555,7 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetUriByFilenameFindsRelativeResourceOnClasspathPrefix() throws Exception { ++ void getUriByFilenameFindsRelativeResourceOnClasspathPrefix() throws Exception { + final String filename = + CommonUtil.CLASSPATH_URL_PROTOCOL + + getPackageLocation() +@@ -568,15 +569,15 @@ public class CommonUtilTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsCodePointWhitespace() { ++ void isCodePointWhitespace() { + final int[] codePoints = " 123".codePoints().toArray(); + assertThat(CommonUtil.isCodePointWhitespace(codePoints, 0)).isTrue(); + assertThat(CommonUtil.isCodePointWhitespace(codePoints, 1)).isFalse(); + } + + @Test +- public void testLoadSuppressionsUriSyntaxException() throws Exception { +- final URL configUrl = mock(URL.class); ++ void loadSuppressionsUriSyntaxException() throws Exception { ++ final URL configUrl = mock(); + when(configUrl.toURI()).thenThrow(URISyntaxException.class); + try (MockedStatic utilities = mockStatic(CommonUtil.class, CALLS_REAL_METHODS)) { + final String fileName = "/suppressions_none.xml"; +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java +index 19873a9ef..21b1b37ef 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/FilterUtilTest.java +@@ -26,19 +26,19 @@ import java.io.File; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + +-public class FilterUtilTest { ++final class FilterUtilTest { + + @TempDir public File temporaryFolder; + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(FilterUtil.class)) + .isTrue(); + } + + @Test +- public void testExistingFile() throws Exception { ++ void existingFile() throws Exception { + final File file = File.createTempFile("junit", null, temporaryFolder); + assertWithMessage("Suppression file exists") + .that(FilterUtil.isFileExists(file.getPath())) +@@ -46,7 +46,7 @@ public class FilterUtilTest { + } + + @Test +- public void testNonExistentFile() { ++ void nonExistentFile() { + assertWithMessage("Suppression file does not exist") + .that(FilterUtil.isFileExists("non-existent.xml")) + .isFalse(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilTest.java +index 2a805fc3d..7f2da869b 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/JavadocUtilTest.java +@@ -35,10 +35,10 @@ import com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTags; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class JavadocUtilTest { ++final class JavadocUtilTest { + + @Test +- public void testTags() { ++ void tags() { + final String[] text = { + "/** @see elsewhere ", + " * {@link List }, {@link List link text }", +@@ -51,7 +51,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testBlockTag() { ++ void blockTag() { + final String[] text = { + "/** @see elsewhere ", " */", + }; +@@ -61,7 +61,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testTagType() { ++ void tagType() { + final String[] text = { + "/** @see block", " * {@link List inline}, {@link List#add(Object)}", + }; +@@ -75,7 +75,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testInlineTagLinkText() { ++ void inlineTagLinkText() { + final String[] text = { + "/** {@link List link text }", + }; +@@ -88,7 +88,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testInlineTagMethodRef() { ++ void inlineTagMethodRef() { + final String[] text = { + "/** {@link List#add(Object)}", + }; +@@ -101,7 +101,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testTagPositions() { ++ void tagPositions() { + final String[] text = { + "/** @see elsewhere", " also {@link Name value} */", + }; +@@ -128,7 +128,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testInlineTagPositions() { ++ void inlineTagPositions() { + final String[] text = {"/** Also {@link Name value} */"}; + final Comment comment = new Comment(text, 1, 0, text[0].length()); + +@@ -143,7 +143,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testInvalidTags() { ++ void invalidTags() { + final String[] text = { + "/** @fake block", " * {@bogus inline}", " * {@link List valid}", + }; +@@ -166,7 +166,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testEmptyBlockComment() { ++ void emptyBlockComment() { + final String emptyComment = ""; + assertWithMessage("Should return false when empty string is passed") + .that(JavadocUtil.isJavadocComment(emptyComment)) +@@ -174,7 +174,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testEmptyBlockCommentAst() { ++ void emptyBlockCommentAst() { + final DetailAstImpl commentBegin = new DetailAstImpl(); + commentBegin.setType(TokenTypes.BLOCK_COMMENT_BEGIN); + commentBegin.setText("/*"); +@@ -196,7 +196,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testEmptyJavadocComment() { ++ void emptyJavadocComment() { + final String emptyJavadocComment = "*"; + assertWithMessage("Should return true when empty javadoc comment is passed") + .that(JavadocUtil.isJavadocComment(emptyJavadocComment)) +@@ -204,7 +204,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testEmptyJavadocCommentAst() { ++ void emptyJavadocCommentAst() { + final DetailAstImpl commentBegin = new DetailAstImpl(); + commentBegin.setType(TokenTypes.BLOCK_COMMENT_BEGIN); + commentBegin.setText("/*"); +@@ -233,14 +233,14 @@ public class JavadocUtilTest { + } + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(JavadocUtil.class)) + .isTrue(); + } + + @Test +- public void testBranchContains() { ++ void branchContains() { + final JavadocNodeImpl node = new JavadocNodeImpl(); + final JavadocNodeImpl firstChild = new JavadocNodeImpl(); + final JavadocNodeImpl secondChild = new JavadocNodeImpl(); +@@ -267,14 +267,14 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetTokenNameForId() { ++ void getTokenNameForId() { + assertWithMessage("Invalid token name") + .that(JavadocUtil.getTokenName(JavadocTokenTypes.EOF)) + .isEqualTo("EOF"); + } + + @Test +- public void testGetTokenNameForLargeId() { ++ void getTokenNameForLargeId() { + try { + JavadocUtil.getTokenName(30073); + assertWithMessage("exception expected").fail(); +@@ -286,7 +286,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetTokenNameForInvalidId() { ++ void getTokenNameForInvalidId() { + try { + JavadocUtil.getTokenName(110); + assertWithMessage("exception expected").fail(); +@@ -298,7 +298,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetTokenNameForLowerBoundInvalidId() { ++ void getTokenNameForLowerBoundInvalidId() { + try { + JavadocUtil.getTokenName(10095); + assertWithMessage("exception expected").fail(); +@@ -310,7 +310,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetTokenIdThatIsUnknown() { ++ void getTokenIdThatIsUnknown() { + try { + JavadocUtil.getTokenId(""); + assertWithMessage("exception expected").fail(); +@@ -322,14 +322,14 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetTokenId() { ++ void getTokenId() { + final int tokenId = JavadocUtil.getTokenId("JAVADOC"); + + assertWithMessage("Invalid token id").that(tokenId).isEqualTo(JavadocTokenTypes.JAVADOC); + } + + @Test +- public void testGetJavadocCommentContent() { ++ void getJavadocCommentContent() { + final DetailAstImpl detailAST = new DetailAstImpl(); + final DetailAstImpl javadoc = new DetailAstImpl(); + +@@ -341,7 +341,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetFirstToken() { ++ void getFirstToken() { + final JavadocNodeImpl javadocNode = new JavadocNodeImpl(); + final JavadocNodeImpl basetag = new JavadocNodeImpl(); + basetag.setType(JavadocTokenTypes.BASE_TAG); +@@ -358,7 +358,7 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetPreviousSibling() { ++ void getPreviousSibling() { + final JavadocNodeImpl root = new JavadocNodeImpl(); + + final JavadocNodeImpl node = new JavadocNodeImpl(); +@@ -377,14 +377,14 @@ public class JavadocUtilTest { + } + + @Test +- public void testGetLastTokenName() { ++ void getLastTokenName() { + assertWithMessage("Unexpected token name") + .that(JavadocUtil.getTokenName(10094)) + .isEqualTo("RP"); + } + + @Test +- public void testEscapeAllControlChars() { ++ void escapeAllControlChars() { + assertWithMessage("invalid result") + .that(JavadocUtil.escapeAllControlChars("abc")) + .isEqualTo("abc"); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtilTest.java +index bac962f5a..106d1b0f0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ModuleReflectionUtilTest.java +@@ -39,17 +39,17 @@ import java.io.File; + import java.util.List; + import org.junit.jupiter.api.Test; + +-public class ModuleReflectionUtilTest { ++final class ModuleReflectionUtilTest { + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(ModuleReflectionUtil.class)) + .isTrue(); + } + + @Test +- public void testIsCheckstyleModule() { ++ void isCheckstyleModule() { + assertWithMessage("Should return true when checkstyle module is passed") + .that(ModuleReflectionUtil.isCheckstyleModule(CheckClass.class)) + .isTrue(); +@@ -74,7 +74,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsValidCheckstyleClass() { ++ void isValidCheckstyleClass() { + assertWithMessage("Should return true when valid checkstyle class is passed") + .that(ModuleReflectionUtil.isCheckstyleModule(ValidCheckstyleClass.class)) + .isTrue(); +@@ -93,7 +93,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsCheckstyleCheck() { ++ void isCheckstyleCheck() { + assertWithMessage("Should return true when valid checkstyle check is passed") + .that(ModuleReflectionUtil.isCheckstyleTreeWalkerCheck(CheckClass.class)) + .isTrue(); +@@ -103,7 +103,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsFileSetModule() { ++ void isFileSetModule() { + assertWithMessage("Should return true when valid checkstyle file set module is passed") + .that(ModuleReflectionUtil.isFileSetModule(FileSetModuleClass.class)) + .isTrue(); +@@ -113,7 +113,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsFilterModule() { ++ void isFilterModule() { + assertWithMessage("Should return true when valid checkstyle filter module is passed") + .that(ModuleReflectionUtil.isFilterModule(FilterClass.class)) + .isTrue(); +@@ -123,7 +123,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsFileFilterModule() { ++ void isFileFilterModule() { + assertWithMessage("Should return true when valid checkstyle file filter module is passed") + .that(ModuleReflectionUtil.isFileFilterModule(FileFilterModuleClass.class)) + .isTrue(); +@@ -133,7 +133,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsTreeWalkerFilterModule() { ++ void isTreeWalkerFilterModule() { + assertWithMessage("Should return true when valid checkstyle TreeWalker filter module is passed") + .that(ModuleReflectionUtil.isTreeWalkerFilterModule(TreeWalkerFilterClass.class)) + .isTrue(); +@@ -143,7 +143,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsAuditListener() { ++ void isAuditListener() { + assertWithMessage("Should return true when valid checkstyle AuditListener module is passed") + .that(ModuleReflectionUtil.isAuditListener(DefaultLogger.class)) + .isTrue(); +@@ -153,7 +153,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testIsRootModule() { ++ void isRootModule() { + assertWithMessage("Should return true when valid checkstyle root module is passed") + .that(ModuleReflectionUtil.isRootModule(RootModuleClass.class)) + .isTrue(); +@@ -163,7 +163,7 @@ public class ModuleReflectionUtilTest { + } + + @Test +- public void testKeepEclipseHappy() { ++ void keepEclipseHappy() { + final InvalidNonDefaultConstructorClass test = new InvalidNonDefaultConstructorClass(0); + assertWithMessage("should use constructor").that(test).isNotNull(); + assertWithMessage("should use field").that(test.getField()).isEqualTo(1); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ParserUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ParserUtilTest.java +index 62f986c88..2a4be5f8d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ParserUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ParserUtilTest.java +@@ -26,17 +26,17 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class ParserUtilTest { ++final class ParserUtilTest { + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(ParserUtil.class)) + .isTrue(); + } + + @Test +- public void testCreationOfFakeCommentBlock() { ++ void creationOfFakeCommentBlock() { + final DetailAST testCommentBlock = ParserUtil.createBlockCommentNode("test_comment"); + assertWithMessage("Invalid token type") + .that(testCommentBlock.getType()) +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilTest.java +index 21b9e960b..82014dee1 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/ScopeUtilTest.java +@@ -28,17 +28,17 @@ import com.puppycrawl.tools.checkstyle.api.Scope; + import com.puppycrawl.tools.checkstyle.api.TokenTypes; + import org.junit.jupiter.api.Test; + +-public class ScopeUtilTest { ++final class ScopeUtilTest { + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(ScopeUtil.class)) + .isTrue(); + } + + @Test +- public void testInClassBlock() { ++ void inClassBlock() { + assertWithMessage("Should return false when passed is not class") + .that(ScopeUtil.isInClassBlock(new DetailAstImpl())) + .isFalse(); +@@ -76,7 +76,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testInEnumBlock() { ++ void inEnumBlock() { + assertWithMessage("Should return false when passed is not enum") + .that(ScopeUtil.isInEnumBlock(new DetailAstImpl())) + .isFalse(); +@@ -114,7 +114,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsInCodeBlock() { ++ void isInCodeBlock() { + assertWithMessage("invalid result") + .that(ScopeUtil.isInCodeBlock(getNode(TokenTypes.CLASS_DEF))) + .isFalse(); +@@ -139,7 +139,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testInRecordBlock() { ++ void inRecordBlock() { + assertWithMessage("Should return false when passed is not record") + .that(ScopeUtil.isInRecordBlock(new DetailAstImpl())) + .isFalse(); +@@ -177,42 +177,42 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsOuterMostTypeInterface() { ++ void isOuterMostTypeInterface() { + assertWithMessage("Should return false when passed is not outer most type") + .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.INTERFACE_DEF, TokenTypes.MODIFIERS))) + .isFalse(); + } + + @Test +- public void testIsOuterMostTypeAnnotation() { ++ void isOuterMostTypeAnnotation() { + assertWithMessage("Should return false when passed is not outer most type") + .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.ANNOTATION_DEF, TokenTypes.MODIFIERS))) + .isFalse(); + } + + @Test +- public void testIsOuterMostTypeEnum() { ++ void isOuterMostTypeEnum() { + assertWithMessage("Should return false when passed is not outer most type") + .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.ENUM_DEF, TokenTypes.MODIFIERS))) + .isFalse(); + } + + @Test +- public void testIsOuterMostTypeClass() { ++ void isOuterMostTypeClass() { + assertWithMessage("Should return false when passed is not outer most type") + .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.CLASS_DEF, TokenTypes.MODIFIERS))) + .isFalse(); + } + + @Test +- public void testIsOuterMostTypePackageDef() { ++ void isOuterMostTypePackageDef() { + assertWithMessage("Should return false when passed is not outer most type") + .that(ScopeUtil.isOuterMostType(getNode(TokenTypes.PACKAGE_DEF, TokenTypes.DOT))) + .isTrue(); + } + + @Test +- public void testIsLocalVariableDefCatch() { ++ void isLocalVariableDefCatch() { + assertWithMessage("Should return true when passed is variable def") + .that( + ScopeUtil.isLocalVariableDef( +@@ -221,7 +221,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsLocalVariableDefUnexpected() { ++ void isLocalVariableDefUnexpected() { + assertWithMessage("Should return false when passed is not variable def") + .that(ScopeUtil.isLocalVariableDef(getNode(TokenTypes.LITERAL_CATCH))) + .isFalse(); +@@ -231,7 +231,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsLocalVariableDefResource() { ++ void isLocalVariableDefResource() { + final DetailAstImpl node = getNode(TokenTypes.RESOURCE); + final DetailAstImpl modifiers = new DetailAstImpl(); + modifiers.setType(TokenTypes.MODIFIERS); +@@ -251,7 +251,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsLocalVariableDefVariable() { ++ void isLocalVariableDefVariable() { + assertWithMessage("invalid result") + .that(ScopeUtil.isLocalVariableDef(getNode(TokenTypes.SLIST, TokenTypes.VARIABLE_DEF))) + .isTrue(); +@@ -269,7 +269,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsClassFieldDef() { ++ void isClassFieldDef() { + assertWithMessage("Should return true when passed is class field def") + .that( + ScopeUtil.isClassFieldDef( +@@ -286,7 +286,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testSurroundingScope() { ++ void surroundingScope() { + final Scope publicScope = + ScopeUtil.getSurroundingScope( + getNodeWithParentScope(TokenTypes.LITERAL_PUBLIC, "public", TokenTypes.ANNOTATION_DEF)); +@@ -307,7 +307,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsInScope() { ++ void isInScope() { + assertWithMessage("Should return true when node is in valid scope") + .that( + ScopeUtil.isInScope( +@@ -325,14 +325,14 @@ public class ScopeUtilTest { + } + + @Test +- public void testSurroundingScopeOfNodeChildOfLiteralNewIsAnoninner() { ++ void surroundingScopeOfNodeChildOfLiteralNewIsAnoninner() { + final Scope scope = + ScopeUtil.getSurroundingScope(getNode(TokenTypes.LITERAL_NEW, TokenTypes.IDENT)); + assertWithMessage("Invalid surrounding scope").that(scope).isEqualTo(Scope.ANONINNER); + } + + @Test +- public void testIsInInterfaceBlock() { ++ void isInInterfaceBlock() { + final DetailAST ast = + getNode( + TokenTypes.INTERFACE_DEF, +@@ -349,7 +349,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testIsInAnnotationBlock() { ++ void isInAnnotationBlock() { + final DetailAST ast = + getNode( + TokenTypes.ANNOTATION_DEF, +@@ -366,7 +366,7 @@ public class ScopeUtilTest { + } + + @Test +- public void testisInInterfaceOrAnnotationBlock() { ++ void isInInterfaceOrAnnotationBlock() { + assertWithMessage("Should return true when node is in interface or annotation block") + .that( + ScopeUtil.isInInterfaceOrAnnotationBlock( +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilTest.java +index 193c632c9..7dbf3161e 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/TokenUtilTest.java +@@ -34,17 +34,17 @@ import java.util.Optional; + import java.util.TreeMap; + import org.junit.jupiter.api.Test; + +-public class TokenUtilTest { ++final class TokenUtilTest { + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(TokenUtil.class)) + .isTrue(); + } + + @Test +- public void testGetIntFromAccessibleField() throws NoSuchFieldException { ++ void getIntFromAccessibleField() throws NoSuchFieldException { + final Field field = Integer.class.getField("MAX_VALUE"); + final int maxValue = TokenUtil.getIntFromField(field, 0); + +@@ -52,7 +52,7 @@ public class TokenUtilTest { + } + + @Test +- public void testGetIntFromInaccessibleField() throws NoSuchFieldException { ++ void getIntFromInaccessibleField() throws NoSuchFieldException { + final Field field = Integer.class.getDeclaredField("value"); + + try { +@@ -72,7 +72,7 @@ public class TokenUtilTest { + } + + @Test +- public void testNameToValueMapFromPublicIntFields() { ++ void nameToValueMapFromPublicIntFields() { + final Map actualMap = + TokenUtil.nameToValueMapFromPublicIntFields(Integer.class); + final Map expectedMap = new TreeMap<>(); +@@ -85,7 +85,7 @@ public class TokenUtilTest { + } + + @Test +- public void testInvertMap() { ++ void invertMap() { + final Map map = new TreeMap<>(); + map.put("ZERO", 0); + map.put("ONE", 1); +@@ -103,7 +103,7 @@ public class TokenUtilTest { + } + + @Test +- public void testTokenValueIncorrect() throws IllegalAccessException { ++ void tokenValueIncorrect() throws IllegalAccessException { + int maxId = 0; + final Field[] fields = TokenTypes.class.getDeclaredFields(); + for (final Field field : fields) { +@@ -131,7 +131,7 @@ public class TokenUtilTest { + } + + @Test +- public void testTokenValueCorrect() throws IllegalAccessException { ++ void tokenValueCorrect() throws IllegalAccessException { + final Field[] fields = TokenTypes.class.getDeclaredFields(); + for (final Field field : fields) { + // Only process the int declarations. +@@ -147,7 +147,7 @@ public class TokenUtilTest { + } + + @Test +- public void testTokenValueIncorrect2() { ++ void tokenValueIncorrect2() { + final int id = 0; + try { + TokenUtil.getTokenName(id); +@@ -160,7 +160,7 @@ public class TokenUtilTest { + } + + @Test +- public void testTokenIdIncorrect() { ++ void tokenIdIncorrect() { + final String id = "NON_EXISTENT_VALUE"; + try { + TokenUtil.getTokenId(id); +@@ -173,7 +173,7 @@ public class TokenUtilTest { + } + + @Test +- public void testShortDescriptionIncorrect() { ++ void shortDescriptionIncorrect() { + final String id = "NON_EXISTENT_VALUE"; + try { + TokenUtil.getShortDescription(id); +@@ -186,7 +186,7 @@ public class TokenUtilTest { + } + + @Test +- public void testIsCommentType() { ++ void isCommentType() { + assertWithMessage("Should return true when valid type passed") + .that(TokenUtil.isCommentType(TokenTypes.SINGLE_LINE_COMMENT)) + .isTrue(); +@@ -211,14 +211,14 @@ public class TokenUtilTest { + } + + @Test +- public void testGetTokenTypesTotalNumber() { ++ void getTokenTypesTotalNumber() { + final int tokenTypesTotalNumber = TokenUtil.getTokenTypesTotalNumber(); + + assertWithMessage("Invalid token total number").that(tokenTypesTotalNumber).isEqualTo(186); + } + + @Test +- public void testGetAllTokenIds() { ++ void getAllTokenIds() { + final int[] allTokenIds = TokenUtil.getAllTokenIds(); + final int sum = Arrays.stream(allTokenIds).sum(); + +@@ -227,7 +227,7 @@ public class TokenUtilTest { + } + + @Test +- public void testGetTokenNameWithGreatestPossibleId() { ++ void getTokenNameWithGreatestPossibleId() { + final int id = TokenTypes.COMMENT_CONTENT; + final String tokenName = TokenUtil.getTokenName(id); + +@@ -235,7 +235,7 @@ public class TokenUtilTest { + } + + @Test +- public void testCorrectBehaviourOfGetTokenId() { ++ void correctBehaviourOfGetTokenId() { + final String id = "COMPILATION_UNIT"; + + assertWithMessage("Invalid token id") +@@ -244,7 +244,7 @@ public class TokenUtilTest { + } + + @Test +- public void testCorrectBehaviourOfShortDescription() { ++ void correctBehaviourOfShortDescription() { + final String id = "COMPILATION_UNIT"; + final String shortDescription = TokenUtil.getShortDescription(id); + +@@ -254,7 +254,7 @@ public class TokenUtilTest { + } + + @Test +- public void testFindFirstTokenByPredicate() { ++ void findFirstTokenByPredicate() { + final DetailAstImpl astForTest = new DetailAstImpl(); + final DetailAstImpl child = new DetailAstImpl(); + final DetailAstImpl firstSibling = new DetailAstImpl(); +@@ -274,7 +274,7 @@ public class TokenUtilTest { + } + + @Test +- public void testForEachChild() { ++ void forEachChild() { + final DetailAstImpl astForTest = new DetailAstImpl(); + final DetailAstImpl child = new DetailAstImpl(); + final DetailAstImpl firstSibling = new DetailAstImpl(); +@@ -296,7 +296,7 @@ public class TokenUtilTest { + } + + @Test +- public void testIsTypeDeclaration() { ++ void isTypeDeclaration() { + assertWithMessage("Should return true when valid type passed") + .that(TokenUtil.isTypeDeclaration(TokenTypes.CLASS_DEF)) + .isTrue(); +@@ -315,7 +315,7 @@ public class TokenUtilTest { + } + + @Test +- public void testIsOfTypeTrue() { ++ void isOfTypeTrue() { + final int type = TokenTypes.LITERAL_CATCH; + final DetailAstImpl astForTest = new DetailAstImpl(); + astForTest.setType(type); +@@ -331,7 +331,7 @@ public class TokenUtilTest { + } + + @Test +- public void testIsOfTypeFalse() { ++ void isOfTypeFalse() { + final int type = TokenTypes.LITERAL_CATCH; + final DetailAstImpl astForTest1 = new DetailAstImpl(); + final DetailAstImpl astForTest2 = null; +@@ -352,7 +352,7 @@ public class TokenUtilTest { + } + + @Test +- public void testIsBooleanLiteralType() { ++ void isBooleanLiteralType() { + assertWithMessage("Result is not expected") + .that(TokenUtil.isBooleanLiteralType(TokenTypes.LITERAL_TRUE)) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/utils/XpathUtilTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/utils/XpathUtilTest.java +index 3403c2612..2433e8750 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/utils/XpathUtilTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/utils/XpathUtilTest.java +@@ -23,6 +23,7 @@ import static com.google.common.truth.Truth.assertWithMessage; + import static com.puppycrawl.tools.checkstyle.AbstractPathTestSupport.addEndOfLine; + import static com.puppycrawl.tools.checkstyle.internal.utils.TestUtil.isUtilsClassHasPrivateConstructor; + import static com.puppycrawl.tools.checkstyle.utils.XpathUtil.getTextAttributeValue; ++import static java.nio.charset.StandardCharsets.UTF_8; + + import com.puppycrawl.tools.checkstyle.DetailAstImpl; + import com.puppycrawl.tools.checkstyle.api.CheckstyleException; +@@ -32,25 +33,24 @@ import com.puppycrawl.tools.checkstyle.xpath.AbstractNode; + import com.puppycrawl.tools.checkstyle.xpath.RootNode; + import java.io.File; + import java.io.IOException; +-import java.nio.charset.StandardCharsets; + import java.nio.file.Files; + import java.util.List; + import org.junit.jupiter.api.Test; + import org.junit.jupiter.api.io.TempDir; + +-public class XpathUtilTest { ++final class XpathUtilTest { + + @TempDir public File tempFolder; + + @Test +- public void testIsProperUtilsClass() throws ReflectiveOperationException { ++ void isProperUtilsClass() throws ReflectiveOperationException { + assertWithMessage("Constructor is not private") + .that(isUtilsClassHasPrivateConstructor(XpathUtil.class)) + .isTrue(); + } + + @Test +- public void testSupportsTextAttribute() { ++ void supportsTextAttribute() { + assertWithMessage("Should return true for supported token types") + .that(XpathUtil.supportsTextAttribute(createDetailAST(TokenTypes.IDENT))) + .isTrue(); +@@ -78,7 +78,7 @@ public class XpathUtilTest { + } + + @Test +- public void testGetValue() { ++ void getValue() { + assertWithMessage("Returned value differs from expected") + .that(getTextAttributeValue(createDetailAST(TokenTypes.STRING_LITERAL, "\"HELLO WORLD\""))) + .isEqualTo("HELLO WORLD"); +@@ -94,10 +94,10 @@ public class XpathUtilTest { + } + + @Test +- public void testPrintXpathNotComment() throws Exception { ++ void printXpathNotComment() throws Exception { + final String fileContent = "class Test { public void method() {int a = 5;}}"; + final File file = File.createTempFile("junit", null, tempFolder); +- Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), fileContent.getBytes(UTF_8)); + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -113,10 +113,10 @@ public class XpathUtilTest { + } + + @Test +- public void testPrintXpathComment() throws Exception { ++ void printXpathComment() throws Exception { + final String fileContent = "class Test { /* comment */ }"; + final File file = File.createTempFile("junit", null, tempFolder); +- Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), fileContent.getBytes(UTF_8)); + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -128,10 +128,10 @@ public class XpathUtilTest { + } + + @Test +- public void testPrintXpathTwo() throws Exception { ++ void printXpathTwo() throws Exception { + final String fileContent = "class Test { public void method() {int a = 5; int b = 5;}}"; + final File file = File.createTempFile("junit", null, tempFolder); +- Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), fileContent.getBytes(UTF_8)); + final String expected = + addEndOfLine( + "COMPILATION_UNIT -> COMPILATION_UNIT [1:0]", +@@ -155,10 +155,10 @@ public class XpathUtilTest { + } + + @Test +- public void testInvalidXpath() throws IOException { ++ void invalidXpath() throws IOException { + final String fileContent = "class Test { public void method() {int a = 5; int b = 5;}}"; + final File file = File.createTempFile("junit", null, tempFolder); +- Files.write(file.toPath(), fileContent.getBytes(StandardCharsets.UTF_8)); ++ Files.write(file.toPath(), fileContent.getBytes(UTF_8)); + final String invalidXpath = "\\//CLASS_DEF" + "//METHOD_DEF//VARIABLE_DEF//IDENT"; + try { + XpathUtil.printXpathBranch(invalidXpath, file); +@@ -176,7 +176,7 @@ public class XpathUtilTest { + } + + @Test +- public void testCreateChildren() { ++ void createChildren() { + final DetailAstImpl rootAst = new DetailAstImpl(); + final DetailAstImpl elementAst = new DetailAstImpl(); + rootAst.addChild(elementAst); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/AttributeNodeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/AttributeNodeTest.java +index 20335e7a6..26d0e8f41 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/AttributeNodeTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/AttributeNodeTest.java +@@ -28,31 +28,31 @@ import net.sf.saxon.tree.iter.AxisIterator; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class AttributeNodeTest { ++final class AttributeNodeTest { + + private static AttributeNode attributeNode; + + @BeforeEach +- public void init() { ++ void init() { + attributeNode = new AttributeNode("name", "value"); + } + + @Test +- public void testGetNamespaceUri() { ++ void getNamespaceUri() { + assertWithMessage("Attribute node should have default namespace URI") + .that(attributeNode.getNamespaceUri()) + .isEqualTo(NamespaceUri.NULL); + } + + @Test +- public void testGetUri() { ++ void getUri() { + assertWithMessage("Attribute node should have blank URI") + .that(attributeNode.getURI()) + .isEqualTo(""); + } + + @Test +- public void testCompareOrder() { ++ void compareOrder() { + try { + attributeNode.compareOrder(null); + assertWithMessage("Exception is excepted").fail(); +@@ -64,7 +64,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetDepth() { ++ void getDepth() { + final UnsupportedOperationException exception = + assertThrows(UnsupportedOperationException.class, attributeNode::getDepth); + assertWithMessage("Invalid exception message") +@@ -74,14 +74,14 @@ public class AttributeNodeTest { + } + + @Test +- public void testHasChildNodes() { ++ void hasChildNodes() { + assertWithMessage("Attribute node shouldn't have children") + .that(attributeNode.hasChildNodes()) + .isFalse(); + } + + @Test +- public void testGetAttributeValue() { ++ void getAttributeValue() { + try { + attributeNode.getAttributeValue("", ""); + assertWithMessage("Exception is excepted").fail(); +@@ -93,7 +93,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetChildren() { ++ void getChildren() { + final UnsupportedOperationException exception = + assertThrows(UnsupportedOperationException.class, attributeNode::getChildren); + assertWithMessage("Invalid exception message") +@@ -103,7 +103,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetParent() { ++ void getParent() { + try { + attributeNode.getParent(); + assertWithMessage("Exception is excepted").fail(); +@@ -115,7 +115,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetRoot() { ++ void getRoot() { + try { + attributeNode.getRoot(); + assertWithMessage("Exception is excepted").fail(); +@@ -127,14 +127,14 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetStringValue() { ++ void getStringValue() { + assertWithMessage("Invalid string value") + .that(attributeNode.getStringValue()) + .isEqualTo("value"); + } + + @Test +- public void testIterate() { ++ void iterate() { + try (AxisIterator ignored = attributeNode.iterateAxis(AxisInfo.SELF)) { + assertWithMessage("Exception is excepted").fail(); + } catch (UnsupportedOperationException ex) { +@@ -145,7 +145,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetLineNumber() { ++ void getLineNumber() { + try { + attributeNode.getLineNumber(); + assertWithMessage("Exception is excepted").fail(); +@@ -157,7 +157,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetColumnNumber() { ++ void getColumnNumber() { + try { + attributeNode.getColumnNumber(); + assertWithMessage("Exception is excepted").fail(); +@@ -169,7 +169,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetTokenType() { ++ void getTokenType() { + try { + attributeNode.getTokenType(); + assertWithMessage("Exception is excepted").fail(); +@@ -181,7 +181,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetUnderlyingNode() { ++ void getUnderlyingNode() { + try { + attributeNode.getUnderlyingNode(); + assertWithMessage("Exception is excepted").fail(); +@@ -193,7 +193,7 @@ public class AttributeNodeTest { + } + + @Test +- public void testGetAllNamespaces() { ++ void getAllNamespaces() { + try { + attributeNode.getAllNamespaces(); + assertWithMessage("Exception is excepted").fail(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/ElementNodeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/ElementNodeTest.java +index 8ae40abca..7900f6062 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/ElementNodeTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/ElementNodeTest.java +@@ -39,7 +39,7 @@ import net.sf.saxon.tree.iter.EmptyIterator; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class ElementNodeTest extends AbstractPathTestSupport { ++final class ElementNodeTest extends AbstractPathTestSupport { + + private static RootNode rootNode; + +@@ -49,14 +49,14 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @BeforeEach +- public void init() throws Exception { ++ void init() throws Exception { + final File file = new File(getPath("InputXpathMapperAst.java")); + final DetailAST rootAst = JavaParser.parseFile(file, JavaParser.Options.WITHOUT_COMMENTS); + rootNode = new RootNode(rootAst); + } + + @Test +- public void testParentChildOrdering() { ++ void parentChildOrdering() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.VARIABLE_DEF); + +@@ -75,7 +75,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testSiblingsOrdering() { ++ void siblingsOrdering() { + final DetailAstImpl detailAst1 = new DetailAstImpl(); + detailAst1.setType(TokenTypes.VARIABLE_DEF); + +@@ -99,7 +99,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testCompareOrderWrongInstance() throws Exception { ++ void compareOrderWrongInstance() throws Exception { + final String xpath = "//OBJBLOCK"; + final List nodes = getXpathItems(xpath, rootNode); + final int result = nodes.get(0).compareOrder(null); +@@ -107,7 +107,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetParent() throws Exception { ++ void getParent() throws Exception { + final String xpath = "//OBJBLOCK"; + final List nodes = getXpathItems(xpath, rootNode); + assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); +@@ -118,7 +118,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testRootOfElementNode() throws Exception { ++ void rootOfElementNode() throws Exception { + final String xpath = "//OBJBLOCK"; + final List nodes = getXpathItems(xpath, rootNode); + assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); +@@ -132,7 +132,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetNodeByValueNumInt() throws Exception { ++ void getNodeByValueNumInt() throws Exception { + final String xPath = "//NUM_INT[@text = 123]"; + final List nodes = getXpathItems(xPath, rootNode); + assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); +@@ -141,7 +141,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetNodeByValueStringLiteral() throws Exception { ++ void getNodeByValueStringLiteral() throws Exception { + final String xPath = "//STRING_LITERAL[@text = 'HelloWorld']"; + final List nodes = getXpathItems(xPath, rootNode); + assertWithMessage("Invalid number of nodes").that(nodes).hasSize(2); +@@ -150,14 +150,14 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetNodeByValueWithSameTokenText() throws Exception { ++ void getNodeByValueWithSameTokenText() throws Exception { + final String xPath = "//MODIFIERS[@text = 'MODIFIERS']"; + final List nodes = getXpathItems(xPath, rootNode); + assertWithMessage("Invalid number of nodes").that(nodes).hasSize(0); + } + + @Test +- public void testGetAttributeValue() { ++ void getAttributeValue() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.IDENT); + detailAST.setText("HelloWorld"); +@@ -170,7 +170,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetAttributeCached() { ++ void getAttributeCached() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.IDENT); + detailAST.setText("HelloWorld"); +@@ -185,7 +185,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetAttributeValueNoAttribute() { ++ void getAttributeValueNoAttribute() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.CLASS_DEF); + detailAST.setText("HelloWorld"); +@@ -198,7 +198,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetAttributeValueWrongAttribute() { ++ void getAttributeValueWrongAttribute() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.IDENT); + detailAST.setText("HelloWorld"); +@@ -211,7 +211,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testIterateAxisEmptyChildren() { ++ void iterateAxisEmptyChildren() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.METHOD_DEF); + final ElementNode elementNode = new ElementNode(rootNode, rootNode, detailAST, 1, 0); +@@ -224,7 +224,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testIterateAxisWithChildren() { ++ void iterateAxisWithChildren() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.METHOD_DEF); + final DetailAstImpl childAst = new DetailAstImpl(); +@@ -240,7 +240,7 @@ public class ElementNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testIterateAxisWithNoSiblings() { ++ void iterateAxisWithNoSiblings() { + final DetailAstImpl detailAST = new DetailAstImpl(); + detailAST.setType(TokenTypes.VARIABLE_DEF); + +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java +index 474d574b2..b3e55ca29 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/RootNodeTest.java +@@ -35,7 +35,7 @@ import net.sf.saxon.tree.iter.EmptyIterator; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class RootNodeTest extends AbstractPathTestSupport { ++final class RootNodeTest extends AbstractPathTestSupport { + + private static RootNode rootNode; + +@@ -45,14 +45,14 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @BeforeEach +- public void init() throws Exception { ++ void init() throws Exception { + final File file = new File(getPath("InputXpathMapperAst.java")); + final DetailAST rootAst = JavaParser.parseFile(file, JavaParser.Options.WITHOUT_COMMENTS); + rootNode = new RootNode(rootAst); + } + + @Test +- public void testCompareOrder() { ++ void compareOrder() { + try { + rootNode.compareOrder(null); + assertWithMessage("Exception is excepted").fail(); +@@ -64,7 +64,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testXpath() throws Exception { ++ void xpath() throws Exception { + final String xpath = "/"; + final List nodes = getXpathItems(xpath, rootNode); + assertWithMessage("Invalid number of nodes").that(nodes).hasSize(1); +@@ -78,34 +78,34 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetDepth() { ++ void getDepth() { + assertWithMessage("Root node depth should be 0").that(rootNode.getDepth()).isEqualTo(0); + } + + @Test +- public void testGetTokenType() { ++ void getTokenType() { + assertWithMessage("Invalid token type") + .that(rootNode.getTokenType()) + .isEqualTo(TokenTypes.COMPILATION_UNIT); + } + + @Test +- public void testGetLineNumber() { ++ void getLineNumber() { + assertWithMessage("Invalid line number").that(rootNode.getLineNumber()).isEqualTo(1); + } + + @Test +- public void testGetColumnNumber() { ++ void getColumnNumber() { + assertWithMessage("Invalid column number").that(rootNode.getColumnNumber()).isEqualTo(0); + } + + @Test +- public void testGetLocalPart() { ++ void getLocalPart() { + assertWithMessage("Invalid local part").that(rootNode.getLocalPart()).isEqualTo("ROOT"); + } + + @Test +- public void testIterate() { ++ void iterate() { + try (AxisIterator following = rootNode.iterateAxis(AxisInfo.FOLLOWING)) { + assertWithMessage("Result iterator does not match expected") + .that(following) +@@ -139,7 +139,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testRootWithNullDetailAst() { ++ void rootWithNullDetailAst() { + final RootNode emptyRootNode = new RootNode(null); + assertWithMessage("Empty node should not have children") + .that(emptyRootNode.hasChildNodes()) +@@ -158,7 +158,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetStringValue() { ++ void getStringValue() { + try { + rootNode.getStringValue(); + assertWithMessage("Exception is excepted").fail(); +@@ -170,7 +170,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetAttributeValue() { ++ void getAttributeValue() { + try { + rootNode.getAttributeValue("", ""); + assertWithMessage("Exception is excepted").fail(); +@@ -182,7 +182,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetDeclaredNamespaces() { ++ void getDeclaredNamespaces() { + try { + rootNode.getDeclaredNamespaces(null); + assertWithMessage("Exception is excepted").fail(); +@@ -194,7 +194,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsId() { ++ void isId() { + try { + rootNode.isId(); + assertWithMessage("Exception is excepted").fail(); +@@ -206,7 +206,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsIdref() { ++ void isIdref() { + try { + rootNode.isIdref(); + assertWithMessage("Exception is excepted").fail(); +@@ -218,7 +218,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsNilled() { ++ void isNilled() { + try { + rootNode.isNilled(); + assertWithMessage("Exception is excepted").fail(); +@@ -230,7 +230,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testIsStreamed() { ++ void isStreamed() { + try { + rootNode.isStreamed(); + assertWithMessage("Exception is excepted").fail(); +@@ -242,7 +242,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetConfiguration() { ++ void getConfiguration() { + try { + rootNode.getConfiguration(); + assertWithMessage("Exception is excepted").fail(); +@@ -254,7 +254,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testSetSystemId() { ++ void setSystemId() { + try { + rootNode.setSystemId("1"); + assertWithMessage("Exception is excepted").fail(); +@@ -266,7 +266,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetSystemId() { ++ void getSystemId() { + try { + rootNode.getSystemId(); + assertWithMessage("Exception is excepted").fail(); +@@ -278,7 +278,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetPublicId() { ++ void getPublicId() { + try { + rootNode.getPublicId(); + assertWithMessage("Exception is excepted").fail(); +@@ -290,7 +290,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testBaseUri() { ++ void baseUri() { + try { + rootNode.getBaseURI(); + assertWithMessage("Exception is excepted").fail(); +@@ -302,7 +302,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testSaveLocation() { ++ void saveLocation() { + try { + rootNode.saveLocation(); + assertWithMessage("Exception is excepted").fail(); +@@ -314,7 +314,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetStringValueCs() { ++ void getStringValueCs() { + try { + rootNode.getUnicodeStringValue(); + assertWithMessage("Exception is excepted").fail(); +@@ -326,7 +326,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testFingerprint() { ++ void fingerprint() { + try { + rootNode.getFingerprint(); + assertWithMessage("Exception is excepted").fail(); +@@ -338,7 +338,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetDisplayName() { ++ void getDisplayName() { + try { + rootNode.getDisplayName(); + assertWithMessage("Exception is excepted").fail(); +@@ -350,7 +350,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetPrefix() { ++ void getPrefix() { + try { + rootNode.getPrefix(); + assertWithMessage("Exception is excepted").fail(); +@@ -362,7 +362,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetSchemaType() { ++ void getSchemaType() { + try { + rootNode.getSchemaType(); + assertWithMessage("Exception is excepted").fail(); +@@ -374,7 +374,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testAtomize() { ++ void atomize() { + try { + rootNode.atomize(); + assertWithMessage("Exception is excepted").fail(); +@@ -386,7 +386,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGenerateId() { ++ void generateId() { + try { + rootNode.generateId(null); + assertWithMessage("Exception is excepted").fail(); +@@ -398,7 +398,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testCopy() { ++ void copy() { + try { + rootNode.copy(null, -1, null); + assertWithMessage("Exception is excepted").fail(); +@@ -410,7 +410,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testGetAllNamespaces() { ++ void getAllNamespaces() { + try { + rootNode.getAllNamespaces(); + assertWithMessage("Exception is excepted").fail(); +@@ -422,7 +422,7 @@ public class RootNodeTest extends AbstractPathTestSupport { + } + + @Test +- public void testSameNodeInfo() { ++ void sameNodeInfo() { + assertWithMessage("Should return true, because object is being compared to itself") + .that(rootNode.isSameNodeInfo(rootNode)) + .isTrue(); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathMapperTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathMapperTest.java +index e049c3bb5..8bc5447e1 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathMapperTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathMapperTest.java +@@ -31,7 +31,7 @@ import java.util.List; + import net.sf.saxon.om.NodeInfo; + import org.junit.jupiter.api.Test; + +-public class XpathMapperTest extends AbstractModuleTestSupport { ++final class XpathMapperTest extends AbstractModuleTestSupport { + + @Override + protected String getPackageLocation() { +@@ -39,7 +39,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNodeOrdering() throws Exception { ++ void nodeOrdering() throws Exception { + final String xpath = "//METHOD_DEF/SLIST/*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -60,7 +60,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFullPath() throws Exception { ++ void fullPath() throws Exception { + final String xpath = + "/COMPILATION_UNIT/CLASS_DEF/OBJBLOCK" + "/METHOD_DEF[1]/SLIST/VARIABLE_DEF[2]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); +@@ -79,7 +79,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testParent() throws Exception { ++ void parent() throws Exception { + final String xpath = "(//VARIABLE_DEF)[1]/.."; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -94,7 +94,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testCurlyBrackets() throws Exception { ++ void curlyBrackets() throws Exception { + final String xpath = "(//RCURLY)[2]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -110,7 +110,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testOr() throws Exception { ++ void or() throws Exception { + final String xpath = "//CLASS_DEF | //METHOD_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -129,7 +129,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testComplexQueryOne() throws Exception { ++ void complexQueryOne() throws Exception { + final String xpath = "//CLASS_DEF | //CLASS_DEF/OBJBLOCK"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -142,7 +142,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testComplexQueryTwo() throws Exception { ++ void complexQueryTwo() throws Exception { + final String xpath = "//PACKAGE_DEF | //PACKAGE_DEF/ANNOTATIONS"; + final RootNode rootNode = getRootNode("InputXpathMapperAnnotation.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -156,7 +156,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testComplexQueryThree() throws Exception { ++ void complexQueryThree() throws Exception { + final String xpath = + "//CLASS_DEF | //CLASS_DEF//METHOD_DEF |" + " /COMPILATION_UNIT/CLASS_DEF/OBJBLOCK"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); +@@ -176,7 +176,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAttributeOr() throws Exception { ++ void attributeOr() throws Exception { + final String xpath = + "//METHOD_DEF[./IDENT[@text='getSomeMethod'] " + "or ./IDENT[@text='nonExistentMethod']]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); +@@ -194,7 +194,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testAttributeAnd() throws Exception { ++ void attributeAnd() throws Exception { + final String xpath = + "//METHOD_DEF[./IDENT[@text='callSomeMethod'] and " + + "../..[./IDENT[@text='InputXpathMapperAst']]]"; +@@ -212,7 +212,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAllElementsWithAttribute() throws Exception { ++ void queryAllElementsWithAttribute() throws Exception { + final String xpath = "//*[./IDENT[@text]]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -220,7 +220,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementByIndex() throws Exception { ++ void queryElementByIndex() throws Exception { + final String xpath = "(//VARIABLE_DEF)[1]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -237,7 +237,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAllVariableDefinitionsWithAttribute() throws Exception { ++ void queryAllVariableDefinitionsWithAttribute() throws Exception { + final String xpath = "//VARIABLE_DEF[./IDENT[@*]]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -245,7 +245,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAllVariableDefWrongAttribute() throws Exception { ++ void queryAllVariableDefWrongAttribute() throws Exception { + final String xpath = "//VARIABLE_DEF[@qwe]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -253,7 +253,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAllMethodDefinitionsInContext() throws Exception { ++ void queryAllMethodDefinitionsInContext() throws Exception { + final String objectXpath = "//CLASS_DEF[./IDENT[@text='InputXpathMapperAst']]//OBJBLOCK"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List objectNodes = getXpathItems(objectXpath, rootNode); +@@ -279,7 +279,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAllClassDefinitions() throws Exception { ++ void queryAllClassDefinitions() throws Exception { + final String xpath = "/COMPILATION_UNIT/CLASS_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -296,7 +296,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryByMethodName() throws Exception { ++ void queryByMethodName() throws Exception { + final String xpath = "//METHOD_DEF[./IDENT[@text='getSomeMethod']]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -311,7 +311,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryMethodDefinitionsByClassName() throws Exception { ++ void queryMethodDefinitionsByClassName() throws Exception { + final String xpath = + "//CLASS_DEF[./IDENT[@text='InputXpathMapperAst']]" + "//OBJBLOCK//METHOD_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); +@@ -332,7 +332,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryByClassNameAndMethodName() throws Exception { ++ void queryByClassNameAndMethodName() throws Exception { + final String xpath = + "//CLASS_DEF[./IDENT[@text='InputXpathMapperAst']]//OBJBLOCK" + + "//METHOD_DEF[./IDENT[@text='getSomeMethod']]"; +@@ -349,7 +349,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryClassDefinitionByClassName() throws Exception { ++ void queryClassDefinitionByClassName() throws Exception { + final String xpath = "//CLASS_DEF[./IDENT[@text='InputXpathMapperAst']]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -364,7 +364,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryWrongClassName() throws Exception { ++ void queryWrongClassName() throws Exception { + final String xpath = "/CLASS_DEF[@text='WrongName']"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -372,7 +372,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryWrongXpath() throws Exception { ++ void queryWrongXpath() throws Exception { + final String xpath = "/WRONG_XPATH"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -380,7 +380,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAncestor() throws Exception { ++ void queryAncestor() throws Exception { + final String xpath = "//VARIABLE_DEF[./IDENT[@text='another']]/ancestor::METHOD_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -394,7 +394,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAncestorOrSelf() throws Exception { ++ void queryAncestorOrSelf() throws Exception { + final String xpath = + "//VARIABLE_DEF[./IDENT[@text='another']]" + "/ancestor-or-self::VARIABLE_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); +@@ -413,7 +413,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryDescendant() throws Exception { ++ void queryDescendant() throws Exception { + final String xpath = "//METHOD_DEF/descendant::EXPR"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -421,7 +421,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryDescendantOrSelf() throws Exception { ++ void queryDescendantOrSelf() throws Exception { + final String xpath = "//METHOD_DEF/descendant-or-self::METHOD_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -441,7 +441,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryNoChild() throws Exception { ++ void queryNoChild() throws Exception { + final String xpath = "//RCURLY/METHOD_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -449,7 +449,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryNoDescendant() throws Exception { ++ void queryNoDescendant() throws Exception { + final String xpath = "//RCURLY/descendant::METHOD_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -457,7 +457,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryRootNotImplementedAxis() throws Exception { ++ void queryRootNotImplementedAxis() throws Exception { + final String xpath = "//namespace::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + try { +@@ -471,7 +471,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementNotImplementedAxis() throws Exception { ++ void queryElementNotImplementedAxis() throws Exception { + final String xpath = "/COMPILATION_UNIT/CLASS_DEF//namespace::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + try { +@@ -485,7 +485,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQuerySelf() throws Exception { ++ void querySelf() throws Exception { + final String objectXpath = "//CLASS_DEF[./IDENT[@text='InputXpathMapperAst']]//OBJBLOCK"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List objectNodes = getXpathItems(objectXpath, rootNode); +@@ -502,7 +502,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryNonExistentAttribute() throws Exception { ++ void queryNonExistentAttribute() throws Exception { + final String xpath = "//CLASS_DEF[./IDENT[@text='InputXpathMapperAst']]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -513,7 +513,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryRootSelf() throws Exception { ++ void queryRootSelf() throws Exception { + final String xpath = "self::node()"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -521,7 +521,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryAnnotation() throws Exception { ++ void queryAnnotation() throws Exception { + final String xpath = "//ANNOTATION[./IDENT[@text='Deprecated']]"; + final RootNode rootNode = getRootNode("InputXpathMapperAnnotation.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -535,7 +535,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryNonExistentAnnotation() throws Exception { ++ void queryNonExistentAnnotation() throws Exception { + final String xpath = "//ANNOTATION[@text='SpringBootApplication']"; + final RootNode rootNode = getRootNode("InputXpathMapperAnnotation.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -543,7 +543,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryEnumDef() throws Exception { ++ void queryEnumDef() throws Exception { + final String xpath = "/COMPILATION_UNIT/ENUM_DEF"; + final RootNode enumRootNode = getRootNode("InputXpathMapperEnum.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, enumRootNode)); +@@ -555,7 +555,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryEnumElementsNumber() throws Exception { ++ void queryEnumElementsNumber() throws Exception { + final String xpath = "/COMPILATION_UNIT/ENUM_DEF/OBJBLOCK/ENUM_CONSTANT_DEF"; + final RootNode enumRootNode = getRootNode("InputXpathMapperEnum.java"); + final List nodes = getXpathItems(xpath, enumRootNode); +@@ -563,7 +563,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryEnumElementByName() throws Exception { ++ void queryEnumElementByName() throws Exception { + final String xpath = "//*[./IDENT[@text='TWO']]"; + final RootNode enumRootNode = getRootNode("InputXpathMapperEnum.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, enumRootNode)); +@@ -579,7 +579,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryInterfaceDef() throws Exception { ++ void queryInterfaceDef() throws Exception { + final String xpath = "//INTERFACE_DEF"; + final RootNode interfaceRootNode = getRootNode("InputXpathMapperInterface.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, interfaceRootNode)); +@@ -591,7 +591,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryInterfaceMethodDefNumber() throws Exception { ++ void queryInterfaceMethodDefNumber() throws Exception { + final String xpath = "//INTERFACE_DEF/OBJBLOCK/METHOD_DEF"; + final RootNode interfaceRootNode = getRootNode("InputXpathMapperInterface.java"); + final List nodes = getXpathItems(xpath, interfaceRootNode); +@@ -599,7 +599,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryInterfaceParameterDef() throws Exception { ++ void queryInterfaceParameterDef() throws Exception { + final String xpath = "//PARAMETER_DEF[./IDENT[@text='someVariable']]/../.."; + final RootNode interfaceRootNode = getRootNode("InputXpathMapperInterface.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, interfaceRootNode)); +@@ -614,7 +614,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIdent() throws Exception { ++ void ident() throws Exception { + final String xpath = "//CLASS_DEF/IDENT[@text='InputXpathMapperAst']"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List nodes = getXpathItems(xpath, rootNode); +@@ -629,7 +629,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIdentByText() throws Exception { ++ void identByText() throws Exception { + final String xpath = "//IDENT[@text='puppycrawl']"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -648,7 +648,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testNumVariableByItsValue() throws Exception { ++ void numVariableByItsValue() throws Exception { + final String xpath = "//VARIABLE_DEF[.//NUM_INT[@text=123]]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -664,7 +664,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testStringVariableByItsValue() throws Exception { ++ void stringVariableByItsValue() throws Exception { + final String xpath = "//VARIABLE_DEF[./ASSIGN/EXPR" + "/STRING_LITERAL[@text='HelloWorld']]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -682,7 +682,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSameNodesByNameAndByText() throws Exception { ++ void sameNodesByNameAndByText() throws Exception { + final String xpath1 = "//VARIABLE_DEF[./IDENT[@text='another']]/ASSIGN/EXPR/STRING_LITERAL"; + final String xpath2 = "//VARIABLE_DEF/ASSIGN/EXPR/STRING_LITERAL[@text='HelloWorld']"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); +@@ -692,7 +692,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodDefByAnnotationValue() throws Exception { ++ void methodDefByAnnotationValue() throws Exception { + final String xpath = + "//METHOD_DEF[.//ANNOTATION[./IDENT[@text='SuppressWarnings']" + + " and .//*[@text='good']]]"; +@@ -709,7 +709,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFirstImport() throws Exception { ++ void firstImport() throws Exception { + final String xpath = "/COMPILATION_UNIT/IMPORT[1]"; + final RootNode rootNode = getRootNode("InputXpathMapperPositions.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -721,7 +721,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSecondImport() throws Exception { ++ void secondImport() throws Exception { + final String xpath = "/COMPILATION_UNIT/IMPORT[2]"; + final RootNode rootNode = getRootNode("InputXpathMapperPositions.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -734,7 +734,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThirdImport() throws Exception { ++ void thirdImport() throws Exception { + final String xpath = "/COMPILATION_UNIT/IMPORT[3]"; + final RootNode rootNode = getRootNode("InputXpathMapperPositions.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -748,7 +748,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLastImport() throws Exception { ++ void lastImport() throws Exception { + final String xpath = "/COMPILATION_UNIT/IMPORT[9]"; + final RootNode rootNode = getRootNode("InputXpathMapperPositions.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -768,7 +768,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFirstCaseGroup() throws Exception { ++ void firstCaseGroup() throws Exception { + final String xpath = + "//CLASS_DEF[./IDENT[@text='InputXpathMapperPositions']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" +@@ -788,7 +788,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSecondCaseGroup() throws Exception { ++ void secondCaseGroup() throws Exception { + final String xpath = + "//CLASS_DEF[./IDENT[@text='InputXpathMapperPositions']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" +@@ -809,7 +809,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testThirdCaseGroup() throws Exception { ++ void thirdCaseGroup() throws Exception { + final String xpath = + "//CLASS_DEF[./IDENT[@text='InputXpathMapperPositions']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" +@@ -831,7 +831,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFourthCaseGroup() throws Exception { ++ void fourthCaseGroup() throws Exception { + final String xpath = + "//CLASS_DEF[./IDENT[@text='InputXpathMapperPositions']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='switchMethod']]" +@@ -854,7 +854,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementFollowingSibling() throws Exception { ++ void queryElementFollowingSibling() throws Exception { + final String xpath = "//METHOD_DEF/following-sibling::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -873,7 +873,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementNoFollowingSibling() throws Exception { ++ void queryElementNoFollowingSibling() throws Exception { + final String xpath = "//CLASS_DEF/following-sibling::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -881,7 +881,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementFollowingSiblingRcurly() throws Exception { ++ void queryElementFollowingSiblingRcurly() throws Exception { + final String xpath = "//METHOD_DEF/following-sibling::RCURLY"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -897,7 +897,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementFollowing() throws Exception { ++ void queryElementFollowing() throws Exception { + final String xpath = "//IDENT[@text='variable']/following::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final List actual = getXpathItems(xpath, rootNode); +@@ -907,7 +907,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementFollowingTwo() throws Exception { ++ void queryElementFollowingTwo() throws Exception { + final String xpath = "//LITERAL_RETURN[.//STRING_LITERAL[@text='HelloWorld']]/following::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -928,7 +928,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementFollowingMethodDef() throws Exception { ++ void queryElementFollowingMethodDef() throws Exception { + final String xpath = "//PACKAGE_DEF/following::METHOD_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -948,7 +948,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementNoFollowing() throws Exception { ++ void queryElementNoFollowing() throws Exception { + final String xpath = "//CLASS_DEF/following::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -956,7 +956,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementPrecedingSibling() throws Exception { ++ void queryElementPrecedingSibling() throws Exception { + final String xpath = "//VARIABLE_DEF[./IDENT[@text='array']]/preceding-sibling::*"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -977,7 +977,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementPrecedingSiblingVariableDef() throws Exception { ++ void queryElementPrecedingSiblingVariableDef() throws Exception { + final String xpath = + "//VARIABLE_DEF[./IDENT[@text='array']]/preceding-sibling::" + "VARIABLE_DEF"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); +@@ -996,7 +996,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementPrecedingSiblingArray() throws Exception { ++ void queryElementPrecedingSiblingArray() throws Exception { + final String xpath = "//VARIABLE_DEF[./IDENT[@text='array']]/preceding-sibling::*[1]"; + final RootNode rootNode = getRootNode("InputXpathMapperAst.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -1014,7 +1014,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementPrecedingOne() throws Exception { ++ void queryElementPrecedingOne() throws Exception { + final String xpath = "//LITERAL_CLASS/preceding::*"; + final RootNode rootNode = getRootNode("InputXpathMapperSingleTopClass.java"); + final DetailAST[] actual = +@@ -1023,7 +1023,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementPrecedingTwo() throws Exception { ++ void queryElementPrecedingTwo() throws Exception { + final String xpath = "//PACKAGE_DEF/DOT/preceding::*"; + final RootNode rootNode = getRootNode("InputXpathMapperSingleTopClass.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -1038,7 +1038,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQueryElementPrecedingLiteralPublic() throws Exception { ++ void queryElementPrecedingLiteralPublic() throws Exception { + final String xpath = "//LITERAL_CLASS/preceding::LITERAL_PUBLIC"; + final RootNode rootNode = getRootNode("InputXpathMapperSingleTopClass.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -1052,7 +1052,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTextBlockByItsValue() throws Exception { ++ void textBlockByItsValue() throws Exception { + final String xpath = + "//TEXT_BLOCK_LITERAL_BEGIN[./TEXT_BLOCK_CONTENT" + + "[@text='\\n &1line\\n >2line\\n <3line\\n ']]"; +@@ -1071,7 +1071,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testQuerySingleLineCommentByCommentContent() throws Exception { ++ void querySingleLineCommentByCommentContent() throws Exception { + final String xpath = "//SINGLE_LINE_COMMENT[./COMMENT_CONTENT[@text=' some comment\\n']]"; + final RootNode rootNode = getRootNodeWithComments("InputXpathMapperSingleLineComment.java"); + final DetailAST[] actual = convertToArray(getXpathItems(xpath, rootNode)); +@@ -1085,7 +1085,7 @@ public class XpathMapperTest extends AbstractModuleTestSupport { + } + + @Test +- public void testManyNestedNodes() throws Exception { ++ void manyNestedNodes() throws Exception { + final String xpath = "//STRING_LITERAL"; + final RootNode rootNode = getRootNode("InputXpathMapperStringConcat.java"); + final List actual = getXpathItems(xpath, rootNode); +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGeneratorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGeneratorTest.java +index cb3d962f9..2b2c0a496 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGeneratorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/XpathQueryGeneratorTest.java +@@ -21,6 +21,7 @@ package com.puppycrawl.tools.checkstyle.xpath; + + import static com.google.common.truth.Truth.assertWithMessage; + ++import com.google.common.collect.ImmutableList; + import com.puppycrawl.tools.checkstyle.AbstractModuleTestSupport; + import com.puppycrawl.tools.checkstyle.JavaParser; + import com.puppycrawl.tools.checkstyle.TreeWalkerAuditEvent; +@@ -32,12 +33,11 @@ import com.puppycrawl.tools.checkstyle.api.Violation; + import java.io.File; + import java.nio.charset.StandardCharsets; + import java.util.Arrays; +-import java.util.Collections; + import java.util.List; + import org.junit.jupiter.api.BeforeEach; + import org.junit.jupiter.api.Test; + +-public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { ++final class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + + private static final int DEFAULT_TAB_WIDTH = 4; + +@@ -51,14 +51,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @BeforeEach +- public void init() throws Exception { ++ void init() throws Exception { + final File file = new File(getPath("InputXpathQueryGenerator.java")); + fileText = new FileText(file, StandardCharsets.UTF_8.name()); + rootAst = JavaParser.parseFile(file, JavaParser.Options.WITH_COMMENTS); + } + + @Test +- public void testClassDef() { ++ void classDef() { + final int lineNumber = 12; + final int columnNumber = 1; + final XpathQueryGenerator queryGenerator = +@@ -76,7 +76,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testMethodDef() { ++ void methodDef() { + final int lineNumber = 45; + final int columnNumber = 5; + final XpathQueryGenerator queryGenerator = +@@ -96,7 +96,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVariableDef() { ++ void variableDef() { + final int lineNumber = 53; + final int columnNumber = 13; + final XpathQueryGenerator queryGenerator = +@@ -126,14 +126,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLcurly() { ++ void lcurly() { + final int lineNumber = 37; + final int columnNumber = 20; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathQueryGenerator']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='Label']]/SLIST/LITERAL_SWITCH/LCURLY"); + assertWithMessage("Generated queries do not match expected ones") +@@ -142,14 +142,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testRcurly() { ++ void rcurly() { + final int lineNumber = 25; + final int columnNumber = 5; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathQueryGenerator']]/OBJBLOCK" + + "/INSTANCE_INIT/SLIST/RCURLY"); + assertWithMessage("Generated queries do not match expected ones") +@@ -158,7 +158,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testExpr() { ++ void expr() { + final int lineNumber = 17; + final int columnNumber = 50; + final XpathQueryGenerator queryGenerator = +@@ -176,14 +176,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLparen() { ++ void lparen() { + final int lineNumber = 45; + final int columnNumber = 31; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathQueryGenerator']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='callSomeMethod']]/LPAREN"); + assertWithMessage("Generated queries do not match expected ones") +@@ -192,7 +192,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEmpty() { ++ void empty() { + final int lineNumber = 300; + final int columnNumber = 300; + final XpathQueryGenerator queryGenerator = +@@ -202,7 +202,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testPackage() { ++ void testPackage() { + final int lineNumber = 2; + final int columnNumber = 1; + final XpathQueryGenerator queryGenerator = +@@ -216,21 +216,21 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testImport() { ++ void testImport() { + final int lineNumber = 5; + final int columnNumber = 1; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='File']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='File']]"); + assertWithMessage("Generated queries do not match expected ones") + .that(actual) + .isEqualTo(expected); + } + + @Test +- public void testMethodParams() { ++ void methodParams() { + final int lineNumber = 72; + final int columnNumber = 30; + final XpathQueryGenerator queryGenerator = +@@ -262,14 +262,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitch() { ++ void testSwitch() { + final int lineNumber = 37; + final int columnNumber = 9; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathQueryGenerator']]" + + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='Label']]/SLIST/LITERAL_SWITCH"); + assertWithMessage("Generated queries do not match expected ones") +@@ -278,7 +278,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testSwitchCase() { ++ void switchCase() { + final int lineNumber = 38; + final int columnNumber = 13; + final XpathQueryGenerator queryGenerator = +@@ -298,7 +298,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testVariableStringLiteral() { ++ void variableStringLiteral() { + final int lineNumber = 47; + final int columnNumber = 26; + final XpathQueryGenerator queryGenerator = +@@ -320,14 +320,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testComma() { ++ void comma() { + final int lineNumber = 66; + final int columnNumber = 36; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputXpathQueryGenerator']]/OBJBLOCK/METHOD_DEF[" + + "./IDENT[@text='foo']]/SLIST/LITERAL_FOR/FOR_ITERATOR/ELIST/COMMA"); +@@ -337,7 +337,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testLiteralVoid() { ++ void literalVoid() { + final int lineNumber = 65; + final int columnNumber = 12; + final XpathQueryGenerator queryGenerator = +@@ -355,42 +355,42 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testFirstImport() { ++ void firstImport() { + final int lineNumber = 4; + final int columnNumber = 1; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='JToolBar']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='JToolBar']]"); + assertWithMessage("Generated queries do not match expected ones") + .that(actual) + .isEqualTo(expected); + } + + @Test +- public void testLastImport() { ++ void lastImport() { + final int lineNumber = 8; + final int columnNumber = 1; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Iterator']]"); ++ ImmutableList.of("/COMPILATION_UNIT/IMPORT[./DOT/IDENT[@text='Iterator']]"); + assertWithMessage("Generated queries do not match expected ones") + .that(actual) + .isEqualTo(expected); + } + + @Test +- public void testImportByText() { ++ void importByText() { + final int lineNumber = 4; + final int columnNumber = 8; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/IMPORT/DOT[./IDENT[@text='JToolBar']]/DOT/IDENT[@text='javax']"); + assertWithMessage("Generated queries do not match expected ones") + .that(actual) +@@ -398,22 +398,21 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testIdent() { ++ void ident() { + final int lineNumber = 12; + final int columnNumber = 14; + final XpathQueryGenerator queryGenerator = + new XpathQueryGenerator(rootAst, lineNumber, columnNumber, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( +- "/COMPILATION_UNIT/CLASS_DEF/IDENT[@text='InputXpathQueryGenerator']"); ++ ImmutableList.of("/COMPILATION_UNIT/CLASS_DEF/IDENT[@text='InputXpathQueryGenerator']"); + assertWithMessage("Generated queries do not match expected ones") + .that(actual) + .isEqualTo(expected); + } + + @Test +- public void testTabWidthBeforeMethodDef() throws Exception { ++ void tabWidthBeforeMethodDef() throws Exception { + final File testFile = new File(getPath("InputXpathQueryGeneratorTabWidth.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); + final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); +@@ -440,7 +439,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTabWidthAfterVoidLiteral() throws Exception { ++ void tabWidthAfterVoidLiteral() throws Exception { + final File testFile = new File(getPath("InputXpathQueryGeneratorTabWidth.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); + final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); +@@ -464,7 +463,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTabWidthBeforeSlist() throws Exception { ++ void tabWidthBeforeSlist() throws Exception { + final File testFile = new File(getPath("InputXpathQueryGeneratorTabWidth.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); + final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); +@@ -475,7 +474,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + new XpathQueryGenerator(detailAst, lineNumber, columnNumber, testFileText, tabWidth); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputXpathQueryGeneratorTabWidth']]/OBJBLOCK" + + "/METHOD_DEF[./IDENT[@text='tabAfterMe']]/SLIST"); +@@ -485,7 +484,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTabWidthEndOfLine() throws Exception { ++ void tabWidthEndOfLine() throws Exception { + final File testFile = new File(getPath("InputXpathQueryGeneratorTabWidth.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); + final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); +@@ -496,7 +495,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + new XpathQueryGenerator(detailAst, lineNumber, columnNumber, testFileText, tabWidth); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathQueryGeneratorTabWidth']]" + + "/OBJBLOCK/VARIABLE_DEF[./IDENT[@text='endLineTab']]/SEMI"); + assertWithMessage("Generated queries do not match expected ones") +@@ -505,7 +504,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testClassDefWithTokenType() { ++ void classDefWithTokenType() { + final int lineNumber = 12; + final int columnNumber = 1; + final XpathQueryGenerator queryGenerator = +@@ -513,15 +512,14 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + rootAst, lineNumber, columnNumber, TokenTypes.CLASS_DEF, fileText, DEFAULT_TAB_WIDTH); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( +- "/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathQueryGenerator']]"); ++ ImmutableList.of("/COMPILATION_UNIT/CLASS_DEF[./IDENT[@text='InputXpathQueryGenerator']]"); + assertWithMessage("Generated queries do not match expected ones") + .that(actual) + .isEqualTo(expected); + } + + @Test +- public void testConstructorWithTreeWalkerAuditEvent() { ++ void constructorWithTreeWalkerAuditEvent() { + final Violation violation = + new Violation(12, 1, "messages.properties", null, null, null, null, null, null); + final TreeWalkerAuditEvent event = +@@ -541,7 +539,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testEscapeCharacters() throws Exception { ++ void escapeCharacters() throws Exception { + final File testFile = new File(getPath("InputXpathQueryGeneratorEscapeCharacters.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); + final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); +@@ -589,7 +587,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTextBlocks() throws Exception { ++ void textBlocks() throws Exception { + final File testFile = new File(getNonCompilablePath("InputXpathQueryGeneratorTextBlock.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); + final DetailAST detailAst = JavaParser.parseFile(testFile, JavaParser.Options.WITHOUT_COMMENTS); +@@ -601,7 +599,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + new XpathQueryGenerator(detailAst, lineNumber, columnNumber, testFileText, tabWidth); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputXpathQueryGeneratorTextBlock']]/OBJBLOCK/" + + "VARIABLE_DEF[./IDENT[@text='testOne']]/ASSIGN/EXPR/" +@@ -613,7 +611,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTextBlocksWithNewLine() throws Exception { ++ void textBlocksWithNewLine() throws Exception { + final File testFile = + new File(getNonCompilablePath("InputXpathQueryGeneratorTextBlockNewLine.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); +@@ -626,7 +624,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + new XpathQueryGenerator(detailAst, lineNumber, columnNumber, testFileText, tabWidth); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputXpathQueryGeneratorTextBlockNewLine']]/OBJBLOCK/" + + "VARIABLE_DEF[./IDENT[@text='testOne']]/ASSIGN/EXPR/" +@@ -638,7 +636,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + } + + @Test +- public void testTextBlocksWithNewCrlf() throws Exception { ++ void textBlocksWithNewCrlf() throws Exception { + final File testFile = + new File(getNonCompilablePath("InputXpathQueryGeneratorTextBlockCrlf.java")); + final FileText testFileText = new FileText(testFile, StandardCharsets.UTF_8.name()); +@@ -651,7 +649,7 @@ public class XpathQueryGeneratorTest extends AbstractModuleTestSupport { + new XpathQueryGenerator(detailAst, lineNumber, columnNumber, testFileText, tabWidth); + final List actual = queryGenerator.generate(); + final List expected = +- Collections.singletonList( ++ ImmutableList.of( + "/COMPILATION_UNIT/CLASS_DEF" + + "[./IDENT[@text='InputXpathQueryGeneratorTextBlockCrlf']]/OBJBLOCK/" + + "VARIABLE_DEF[./IDENT[@text='testOne']]/ASSIGN/EXPR/" +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/DescendantIteratorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/DescendantIteratorTest.java +index aaeb4a603..1942ea8ad 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/DescendantIteratorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/DescendantIteratorTest.java +@@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f + import net.sf.saxon.om.NodeInfo; + import org.junit.jupiter.api.Test; + +-public class DescendantIteratorTest { ++final class DescendantIteratorTest { + + @Test +- public void testIncludeSelf() { ++ void includeSelf() { + final NodeInfo startNode = findNode("CLASS_DEF"); + + try (DescendantIterator iterator = +@@ -46,7 +46,7 @@ public class DescendantIteratorTest { + } + + @Test +- public void testWithoutSelf() { ++ void withoutSelf() { + final NodeInfo startNode = findNode("CLASS_DEF"); + + try (DescendantIterator iterator = +@@ -62,7 +62,7 @@ public class DescendantIteratorTest { + } + + @Test +- public void testWithNull() { ++ void withNull() { + final NodeInfo startNode = findNode("CLASS_DEF"); + + try (DescendantIterator iterator = new DescendantIterator(startNode, null)) { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/FollowingIteratorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/FollowingIteratorTest.java +index 0dd51e526..d18de55bb 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/FollowingIteratorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/FollowingIteratorTest.java +@@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f + import net.sf.saxon.om.NodeInfo; + import org.junit.jupiter.api.Test; + +-public class FollowingIteratorTest { ++final class FollowingIteratorTest { + + @Test +- public void testFollowingSibling() { ++ void followingSibling() { + final NodeInfo startNode = findNode("ANNOTATIONS"); + + try (FollowingIterator iterator = new FollowingIterator(startNode)) { +@@ -45,7 +45,7 @@ public class FollowingIteratorTest { + } + + @Test +- public void testNoSibling() { ++ void noSibling() { + final NodeInfo startNode = findNode("CLASS_DEF"); + + try (FollowingIterator iterator = new FollowingIterator(startNode)) { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/PrecedingIteratorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/PrecedingIteratorTest.java +index 70dcaaeb2..7e53921c0 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/PrecedingIteratorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/PrecedingIteratorTest.java +@@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f + import net.sf.saxon.om.NodeInfo; + import org.junit.jupiter.api.Test; + +-public class PrecedingIteratorTest { ++final class PrecedingIteratorTest { + + @Test +- public void testPrecedingNodes() { ++ void precedingNodes() { + final NodeInfo startNode = findNode("SLIST"); + + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { +@@ -47,7 +47,7 @@ public class PrecedingIteratorTest { + } + + @Test +- public void testNoParent() { ++ void noParent() { + final NodeInfo startNode = findNode("ROOT"); + + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { +@@ -56,7 +56,7 @@ public class PrecedingIteratorTest { + } + + @Test +- public void testReverseOrderOfDescendants() { ++ void reverseOrderOfDescendants() { + final NodeInfo startNode = findNode("RCURLY"); + + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { +@@ -75,7 +75,7 @@ public class PrecedingIteratorTest { + } + + @Test +- public void testNoSibling() { ++ void noSibling() { + final NodeInfo startNode = findNode("ANNOTATIONS"); + + try (PrecedingIterator iterator = new PrecedingIterator(startNode)) { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseDescendantIteratorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseDescendantIteratorTest.java +index 3e97c2a3e..3ae9bb78d 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseDescendantIteratorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseDescendantIteratorTest.java +@@ -25,10 +25,10 @@ import static com.puppycrawl.tools.checkstyle.internal.utils.XpathIteratorUtil.f + import net.sf.saxon.om.NodeInfo; + import org.junit.jupiter.api.Test; + +-public class ReverseDescendantIteratorTest { ++final class ReverseDescendantIteratorTest { + + @Test +- public void testCorrectOrder() { ++ void correctOrder() { + final NodeInfo startNode = findNode("CLASS_DEF"); + + try (ReverseDescendantIterator iterator = new ReverseDescendantIterator(startNode)) { +diff --git a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseListIteratorTest.java b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseListIteratorTest.java +index 17a0c8fe0..95076f9cc 100644 +--- a/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseListIteratorTest.java ++++ b/src/test/java/com/puppycrawl/tools/checkstyle/xpath/iterators/ReverseListIteratorTest.java +@@ -31,10 +31,10 @@ import net.sf.saxon.om.NodeInfo; + import net.sf.saxon.om.TreeInfo; + import org.junit.jupiter.api.Test; + +-public class ReverseListIteratorTest { ++final class ReverseListIteratorTest { + + @Test +- public void testCorrectOrder() { ++ void correctOrder() { + final List nodes = Arrays.asList(new TestNode(), new TestNode(), new TestNode()); + + try (ReverseListIterator iterator = new ReverseListIterator(nodes)) { +@@ -46,7 +46,7 @@ public class ReverseListIteratorTest { + } + + @Test +- public void testNullList() { ++ void nullList() { + try (ReverseListIterator iterator = new ReverseListIterator(null)) { + assertWithMessage("Node should be null").that(iterator.next()).isNull(); + } diff --git a/integration-tests/checkstyle-checkstyle-10.9.3-expected-warnings.txt b/integration-tests/checkstyle-checkstyle-10.9.3-expected-warnings.txt new file mode 100644 index 0000000000..b2521aaf43 --- /dev/null +++ b/integration-tests/checkstyle-checkstyle-10.9.3-expected-warnings.txt @@ -0,0 +1,99 @@ +src/test/resources/com/puppycrawl/tools/checkstyle/grammar/antlr4/InputAntlr4AstRegressionTrickyYield.java:[8,16] 'yield' may become a restricted identifier in a future release +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/illegalinstantiation/InputIllegalInstantiationLang3.java:[12,19] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/illegalinstantiation/InputIllegalInstantiationLang3.java:[13,20] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic9.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic9.java:[32,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic9.java:[39,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/magicnumber/InputMagicNumber_6.java:[154,40] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsingleline/InputRegexpSinglelineSemantic3.java:[28,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsingleline/InputRegexpSinglelineSemantic3.java:[33,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsingleline/InputRegexpSinglelineSemantic3.java:[40,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/finallocalvariable/InputFinalLocalVariableFalsePositives.java:[153,35] getSecurityManager() in java.lang.System has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/innerassignment/InputInnerAssignment.java:[26,21] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/imports/avoidstaticimport/InputAvoidStaticImportDefault.java:[114,17] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/indentation/InputIndentationTryWithResourcesStrict.java:[59,69] non-varargs call of varargs method with inexact argument type for last parameter; +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic.java:[32,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic.java:[39,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic4.java:[29,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic4.java:[34,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic4.java:[41,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic9.java:[29,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic9.java:[34,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic9.java:[41,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/metrics/classfanoutcomplexity/InputClassFanOutComplexityAnnotations.java:[72,20] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic2.java:[29,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic2.java:[34,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic2.java:[41,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/imports/avoidstarimport/InputAvoidStarImportDefault.java:[113,17] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/imports/redundantimport/InputRedundantImportWithChecker.java:[113,17] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/javadocmissingleadingasterisk/InputJavadocMissingLeadingAsteriskCorrect.java:[83,1] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemanticText.java:[23,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemanticText.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemanticText.java:[33,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/imports/unusedimports/InputUnusedImports.java:[113,17] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic14.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic14.java:[32,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic14.java:[39,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsingleline/InputRegexpSinglelineSemantic8.java:[28,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsingleline/InputRegexpSinglelineSemantic8.java:[33,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsingleline/InputRegexpSinglelineSemantic8.java:[40,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemanticStatement.java:[23,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemanticStatement.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemanticStatement.java:[33,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic6.java:[28,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic6.java:[33,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic6.java:[40,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/magicnumber/InputMagicNumber.java:[154,40] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic6.java:[29,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic6.java:[34,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpmultiline/InputRegexpMultilineSemantic6.java:[41,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[63,22] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[71,22] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[78,24] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[85,24] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[93,24] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[99,22] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[105,22] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/it/resources/com/google/checkstyle/test/chapter4formatting/rule4861blockcommentstyle/InputCommentsIndentationCommentIsAtTheEndOfBlock.java:[113,22] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic2.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic2.java:[32,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic2.java:[39,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[53,12] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[82,10] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[100,12] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[115,12] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[137,16] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[166,14] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[185,16] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[199,16] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[215,16] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[243,14] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[261,16] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[275,16] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[25,1] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrect.java:[291,1] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/hiddenfield/InputHiddenFieldLambdas.java:[29,21] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/annotation/missingdeprecated/InputMissingDeprecatedSpecialCase.java:[21,16] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/annotation/missingdeprecated/InputMissingDeprecatedSpecialCase.java:[26,17] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/annotation/missingdeprecated/InputMissingDeprecatedSpecialCase.java:[99,11] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/annotation/missingdeprecated/InputMissingDeprecatedSpecialCase.java:[106,11] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/annotation/missingdeprecated/InputMissingDeprecatedSpecialCase.java:[113,22] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic5.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic5.java:[32,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic5.java:[39,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/indentation/indentation/InputIndentationChainedMethods.java:[10,13] non-varargs call of varargs method with inexact argument type for last parameter; +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic2.java:[28,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic2.java:[33,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexpsinglelinejava/InputRegexpSinglelineJavaSemantic2.java:[40,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic6.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic6.java:[32,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/regexp/regexp/InputRegexpSemantic6.java:[39,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/magicnumber/InputMagicNumber_2.java:[154,40] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/coding/magicnumber/InputMagicNumber_3.java:[160,40] Integer(int) in java.lang.Integer has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemantic.java:[23,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemantic.java:[27,21] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/blocks/emptyblock/InputEmptyBlockSemantic.java:[33,16] Boolean(boolean) in java.lang.Boolean has been deprecated and marked for removal +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrectCustom.java:[52,12] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrectCustom.java:[81,10] deprecated item is not annotated with @Deprecated +src/test/resources/com/puppycrawl/tools/checkstyle/checks/javadoc/atclauseorder/InputAtclauseOrderIncorrectCustom.java:[99,12] deprecated item is not annotated with @Deprecated diff --git a/integration-tests/checkstyle-checkstyle-10.9.3-init.patch b/integration-tests/checkstyle-checkstyle-10.9.3-init.patch new file mode 100644 index 0000000000..70255212a6 --- /dev/null +++ b/integration-tests/checkstyle-checkstyle-10.9.3-init.patch @@ -0,0 +1,131 @@ +diff --git a/config/archunit-store/slices-should-be-free-of-cycles-suppressions b/config/archunit-store/slices-should-be-free-of-cycles-suppressions +index ea99a44ee..05a77e1e6 100644 +--- a/config/archunit-store/slices-should-be-free-of-cycles-suppressions ++++ b/config/archunit-store/slices-should-be-free-of-cycles-suppressions +@@ -1351,8 +1351,8 @@ Cycle detected: Slice checks.javadoc -> \ + - Constructor ()> calls method in (AtclauseOrderCheck.java:177)\ + - Method calls method in (JavadocTagContinuationIndentationCheck.java:177)\ + - Method calls method in (RequireEmptyLineBeforeBlockTagGroupCheck.java:177)\ ++ - Method calls method in (JavadocNodeImpl.java:178)\ + - Method calls method in (JavadocTagInfo.java:178)\ +- - Method calls method in (JavadocNodeImpl.java:179)\ + - Method calls method in (AbstractJavadocCheck.java:181)\ + - Method calls method in (RequireEmptyLineBeforeBlockTagGroupCheck.java:183)\ + - Method calls method in (NonEmptyAtclauseDescriptionCheck.java:185)\ +diff --git a/pom.xml b/pom.xml +index 6169c87e0..491c7fa88 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -230,10 +230,12 @@ + 1.1.2 + 1.0.4 + **/test/resources/**/*,**/it/resources/**/* ++ 3.24.2 + 5.9.2 + 3.4 + 1.2.0 +- 2.18.0 ++ 2.22.0 ++ 0.14.0 + 3.27.0 + + +@@ -277,6 +279,12 @@ + + + ++ ++ org.assertj ++ assertj-core ++ ${assertj.version} ++ test ++ + + org.junit.jupiter + junit-jupiter-api +@@ -2305,7 +2313,7 @@ + -Xpkginfo:always + -XDcompilePolicy=simple + +- -Xplugin:ErrorProne ++ -Xplugin:ErrorProne ${error-prone.flags} + + + +@@ -2314,6 +2322,16 @@ + error_prone_core + ${error-prone.version} + ++ ++ tech.picnic.error-prone-support ++ error-prone-contrib ++ ${error-prone-support.version} ++ ++ ++ tech.picnic.error-prone-support ++ refaster-runner ++ ${error-prone-support.version} ++ + + + +@@ -2358,7 +2376,8 @@ + -XDcompilePolicy=simple + + -Xplugin:ErrorProne \ +- -XepExcludedPaths:.*[\\/]resources[\\/].* ++ -XepExcludedPaths:.*[\\/]resources[\\/].* \ ++ ${error-prone.flags} + + + +@@ -2367,6 +2386,16 @@ + error_prone_core + ${error-prone.version} + ++ ++ tech.picnic.error-prone-support ++ error-prone-contrib ++ ${error-prone-support.version} ++ ++ ++ tech.picnic.error-prone-support ++ refaster-runner ++ ${error-prone-support.version} ++ + + + +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java b/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java +index 61c59b613..9019964ad 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/DetailNodeTreeStringPrinter.java +@@ -63,6 +63,7 @@ public final class DetailNodeTreeStringPrinter { + * @return DetailNode tree + * @throws IllegalArgumentException if there is an error parsing the Javadoc. + */ ++ @SuppressWarnings("CheckArgumentWithMessage") + public static DetailNode parseJavadocAsDetailNode(DetailAST blockComment) { + final JavadocDetailNodeParser parser = new JavadocDetailNodeParser(); + final ParseStatus status = parser.parseJavadocAsDetailNode(blockComment); +diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java +index fd90c4259..0c1b4f141 100644 +--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java ++++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/JavadocNodeImpl.java +@@ -20,7 +20,6 @@ + package com.puppycrawl.tools.checkstyle.checks.javadoc; + + import java.util.Arrays; +-import java.util.Objects; + import java.util.Optional; + + import com.puppycrawl.tools.checkstyle.api.DetailNode; +@@ -180,7 +179,7 @@ public class JavadocNodeImpl implements DetailNode { + + ", text='" + text + '\'' + + ", lineNumber=" + lineNumber + + ", columnNumber=" + columnNumber +- + ", children=" + Objects.hashCode(children) ++ + ", children=" + Arrays.hashCode(children) + + ", parent=" + parent + ']'; + } + diff --git a/integration-tests/run.sh b/integration-tests/run.sh new file mode 100755 index 0000000000..92468056cb --- /dev/null +++ b/integration-tests/run.sh @@ -0,0 +1,111 @@ +#!/usr/bin/env bash + +set -e -u -o pipefail + +project=checkstyle +revision=checkstyle-10.9.3 + +if [ "${#}" -gt 1 ] || [[ ${1:---sync} != '--sync' ]]; then + echo "Usage: ${0} [--sync]" + exit 1 +fi +do_sync="${1:-}" + +error_prone_support_version="$( + mvn -f .. help:evaluate -Dexpression=project.version -q -DforceStdout +)" + +error_prone_shared_flags='-XepExcludedPaths:(\Q${project.basedir}${file.separator}src${file.separator}\E(it|test)\Q${file.separator}resources\E|\Q${project.build.directory}${file.separator}\E).*' + +error_prone_patch_flags="${error_prone_shared_flags} -XepPatchLocation:IN_PLACE -XepPatchChecks:$( + find .. -path "*/META-INF/services/com.google.errorprone.bugpatterns.BugChecker" \ + | xargs grep -hoP '[^.]+$' \ + | paste -s -d ',' +)" + +error_prone_validation_flags="${error_prone_shared_flags} -XepDisableAllChecks $( + find .. -path "*/META-INF/services/com.google.errorprone.bugpatterns.BugChecker" \ + | xargs grep -hoP '[^.]+$' \ + | sed -r 's,(.*),-Xep:\1:WARN,' \ + | paste -s -d ' ' +)" + +validation_log_file="$(mktemp)" +trap 'rm -rf -- "${validation_log_file}"' INT TERM HUP EXIT + +echo "Error Prone Support version: ${error_prone_support_version}" +echo "Error Prone patch flags: ${error_prone_patch_flags}" +echo "Error Prone validation flags: ${error_prone_validation_flags}" + +pushd "${project}" + +git checkout -f "${revision}" +git apply < "../${project}-${revision}-init.patch" +git commit -m 'dependency: Introduce Error Prone Support' . + +mvn com.spotify.fmt:fmt-maven-plugin:2.19:format \ + -DadditionalSourceDirectories='${project.basedir}${file.separator}src${file.separator}it${file.separator}java' +git commit -m 'minor: Reformat using Google Java Format' . + +function apply_patch() { + local current_diff="${1}" + + mvn clean package com.spotify.fmt:fmt-maven-plugin:2.19:format \ + -DadditionalSourceDirectories='${project.basedir}${file.separator}src${file.separator}it${file.separator}java' \ + -Perror-prone-compile,error-prone-test-compile \ + -Derror-prone.flags="${error_prone_patch_flags}" \ + -Derror-prone-support.version="${error_prone_support_version}" \ + -DskipTests + + local new_diff="$(git diff | shasum --algorithm 256)" + + if [ "${current_diff}" != "${new_diff}" ]; then + apply_patch "${new_diff}" + fi +} + +apply_patch "$(git diff | shasum --algorithm 256)" + +# disable sync mechanism, we just want to upload the changes +baseline_patch="../${project}-${revision}-expected-changes.patch" +# if [ -n "${do_sync}" ]; then +echo 'Saving changes...' +git diff > "${baseline_patch}" +# else +# echo 'Inspecting changes...' +# if ! diff -u "${baseline_patch}" <(git diff); then +# echo 'There are unexpected changes.' +# exit 1 +# fi +# fi + +# Validate the results. +# +# - The `metadataFilesGenerationAllFiles` test is skipped because is makes line +# number assertions that will fail when the code is formatted or patched. +# - The `allCheckSectionJavaDocs` test is skipped because is validates that +# Javadoc has certain closing tags that are removed by Google Java Format. +# XXX: Figure out why the `validateCliDocSections` test fails. +echo "Validation file: ${validation_log_file}" +mvn clean package \ + -Perror-prone-compile,error-prone-test-compile \ + -Derror-prone.flags="${error_prone_validation_flags}" \ + -Derror-prone-support.version="${error_prone_support_version}" \ + -Dmaven.compiler.showWarnings \ + | tee "${validation_log_file}" +echo "Finished validation run!" + +baseline_warnings="../${project}-${revision}-expected-warnings.txt" +# note: added '*' in the final grep, required in order to get matches in GNU grep 3.11 +# disable sync mechanism, we just want to upload the expected warnings +generated_warnings="$(grep -oP "(?<=^\\Q[WARNING] ${PWD}/\\E).*" "${validation_log_file}" | grep -P '\]*\[')" +# if [ -n "${do_sync}" ]; then +echo 'Saving emitted warnings...' +echo "${generated_warnings}" > "${baseline_warnings}" +# else +# echo 'Inspecting emitted warnings...' +# if ! diff -u "${baseline_warnings}" <(echo "${generated_warnings}"); then +# echo 'Diagnostics output changed.' +# exit 1 +# fi +# fi