VisitorsBridge { public void endOfAnalysis() { allScanners.stream() .filter(s -> s instanceof EndOfAnalysisCheck) .map(EndOfAnalysisCheck.class::cast) .forEach(EndOfAnalysisCheck::endOfAnalysis); } @VisibleForTesting  VisitorsBridge(JavaFileScanner visitor); @VisibleForTesting  VisitorsBridge(Iterable<? extends JavaCheck> visitors, List<File> projectClasspath,
                        @Nullable SonarComponents sonarComponents);  VisitorsBridge(Iterable<? extends JavaCheck> visitors, List<File> projectClasspath,
                        @Nullable SonarComponents sonarComponents, SymbolicExecutionMode symbolicExecutionMode);  VisitorsBridge(Iterable<? extends JavaCheck> visitors, List<File> projectClasspath,
                        @Nullable SonarComponents sonarComponents, SymbolicExecutionMode symbolicExecutionMode,
                        @Nullable JavaFileScanner analysisIssueFilter); JavaVersion getJavaVersion(); List<File> getClasspath(); void setJavaVersion(JavaVersion javaVersion); void visitFile(@Nullable Tree parsedTree); void processRecognitionException(RecognitionException e, InputFile inputFile); void setCurrentFile(InputFile inputFile); void endOfAnalysis();  }
@Test @Disabled("Missing classes are not logged anymore since ECJ migration") void log_only_50_elements() { DecimalFormat formatter = new DecimalFormat("00"); IntFunction<String> classNotFoundName = i -> "NotFound" + formatter.format(i); VisitorsBridge visitorsBridge = new VisitorsBridge(Collections.singletonList((JavaFileScanner) context -> { assertThat(context.getSemanticModel()).isNotNull(); }), new ArrayList<>(), null); checkFile("Foo.java", "class Foo {}", visitorsBridge); visitorsBridge.endOfAnalysis(); assertThat(logTester.logs(LoggerLevel.WARN)).containsOnly( "Classes not found during the analysis : [" + IntStream.range(0, 50 ).mapToObj(classNotFoundName).sorted().collect(Collectors.joining(", ")) + ", ...]"); }