void () { CoverageSuitesBundle suite = new CoverageSuitesBundle(new JavaCoverageSuite(new JavaCoverageEngine())) { @NotNull @Override public ProjectData getCoverageData() { return new ProjectData() { @Override public ClassData getClassData(String name) { ClassData data = new ClassData(name); LineData lineData = new LineData(1, "foo"); lineData.setHits(1); data.registerMethodSignature(lineData); LineData lineData1 = new LineData(2, "bar"); data.registerMethodSignature(lineData1); data.setLines(new LineData[] {lineData, lineData1}); return data; } }; } }; JavaCoverageSuite javaCoverageSuite = (JavaCoverageSuite)suite.getSuites()[0]; javaCoverageSuite.setIncludeFilters(new String[]{"p.*"}); Map<VirtualFile, PackageAnnotator.PackageCoverageInfo> dirs = new HashMap<>(); new JavaCoverageClassesAnnotator(suite, myProject, new Annotator() { @Override public void annotateSourceDirectory(VirtualFile virtualFile, PackageAnnotator.PackageCoverageInfo packageCoverageInfo) { dirs.put(virtualFile, packageCoverageInfo); } }).visitSuite(); assertEquals(2, dirs.size()); for (PackageAnnotator.PackageCoverageInfo coverageInfo : dirs.values()) { assertTrue(coverageInfo instanceof PackageAnnotator.DirCoverageInfo); assertEquals(1, coverageInfo.coveredClassCount); assertEquals(1, coverageInfo.coveredLineCount); assertEquals(1, coverageInfo.coveredMethodCount); } }