void (String className, String methodName, double finalValue) { PsiMethod streamMethod = getMethod(className, methodName); final JavaFindUsagesHandlerFactory factory = JavaFindUsagesHandlerFactory.getInstance(getProject()); JavaFindUsagesHandler handler = new JavaFindUsagesHandler(streamMethod, factory); ClusteringSearchSession session = new ClusteringSearchSession(); handler.processElementUsages(streamMethod, info -> { try { ReadAction.nonBlocking(() -> UsageInfoToUsageConverter.convertToSimilarUsage(new PsiMethod[]{streamMethod}, info, session)).submit( AppExecutorUtil.getAppExecutorService()).get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException(e); } return true; }, factory.getFindMethodOptions()); double silhouetteScore = new SilhouetteScore(session).getSilhouetteScoreResult(); assertEquals("", finalValue, silhouetteScore); }