boolean (final Set<UsageInfo> toMakeStatic) { if (!toMakeStatic.isEmpty()) { myAdditionalMethods = new ArrayList<>(); if (ApplicationManager.getApplication().isUnitTestMode()) { for (UsageInfo usageInfo : toMakeStatic) { myAdditionalMethods.add((PsiMethod)usageInfo.getElement()); } } else { final JavaCallerChooser chooser = new MakeStaticJavaCallerChooser(myMember, myProject, methods -> myAdditionalMethods.addAll(methods)) { @Override protected ArrayList<UsageInfo> getTopLevelItems() { return new ArrayList<>(toMakeStatic); } }; TreeUtil.expand(chooser.getTree(), 2); if (!chooser.showAndGet()) { return false; } } } return true; }