protected static void checkDuplicateTestConfiguration(final String arg, final Pattern... patterns) throws Exception {
        var failBuild = new AtomicBoolean(false);
        Files.walk(Paths.get(arg))
            .filter(file -> Files.isRegularFile(file) && file.toFile().getName().endsWith("Tests.java"))
            .forEach(file -> {
                var text = readFile(file);
                
                for (var patternClasses : patterns) {
                    var matcher = patternClasses.matcher(text);

                    while (matcher.find()) {
                        var testClasses = matcher.group(1)
                            .replaceAll("\n", "")
                            .trim()
                            .replaceAll("\\s", "")
                            .split(",");
                        var setOfClasses = new HashSet<>();
                        for (var testClass : testClasses) {
                            if (!setOfClasses.add(testClass)) {
                                print("Class %s is duplicated in %s", testClass, file.toFile().getName());
                                failBuild.set(true);
                            }
                        }
                        setOfClasses.clear();
                    }
                }
            });

        if (failBuild.get()) {
            System.exit(1);
        }
    }
This is {@link CheckRedundantTestConfigurationInheritance}.

@author Misagh Moayyed
@since 6.3.0
ci/checks/CheckRedundantTestConfigurationInheritance.java