void (@NotNull Consumer<ExcludesConfiguration> excludesConfigurationPatcher, int expectedUsagesCount, String... testFiles) { final ExcludesConfiguration excludesConfiguration = CompilerConfiguration.getInstance(myProject).getExcludedEntriesConfiguration(); try { configureByFiles(getName(), Arrays.stream(testFiles).map(f -> getName() + "/" + f).toArray(String[]::new)); excludesConfigurationPatcher.consume(excludesConfiguration); assertSize(expectedUsagesCount, FunctionalExpressionSearch.search(myJavaFacade.findClass(CommonClassNames.JAVA_LANG_RUNNABLE)).findAll()); myCompilerTester.rebuild(); assertSize(expectedUsagesCount, FunctionalExpressionSearch.search(myJavaFacade.findClass(CommonClassNames.JAVA_LANG_RUNNABLE)).findAll()); } finally { excludesConfiguration.removeAllExcludeEntryDescriptions(); } }