void (@NotNull AnActionEvent e) { final DataContext dataContext = e.getDataContext(); final PsiElement[] psiElements = PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.getData(dataContext); if (psiElements == null) return; final LinkedHashSet<PsiElement> classes = new LinkedHashSet<>(); PsiElementProcessor.CollectElements<PsiElement> processor = new PsiElementProcessor.CollectElements<>(classes); getPatternBasedProducer().collectTestMembers(psiElements, true, true, processor); final Project project = CommonDataKeys.PROJECT.getData(dataContext); final List<T> patternConfigurations = collectPatternConfigurations(classes, project); if (patternConfigurations.size() == 1) { final T configuration = patternConfigurations.get(0); for (PsiElement aClass : classes) { String qName = getPatternBasedProducer().getQName(aClass); if (qName != null) { getPatterns(configuration).add(qName); } } } else { JBPopupFactory.getInstance().createListPopup( new BaseListPopupStep<>(JavaCompilerBundle.message("popup.title.choose.suite.to.add"), patternConfigurations) { @Override public PopupStep onChosen(T configuration, boolean finalChoice) { for (PsiElement aClass : classes) { String qName = getPatternBasedProducer().getQName(aClass); if (qName != null) { getPatterns(configuration).add(qName); } } return FINAL_CHOICE; } @Override public Icon getIconFor(T configuration) { return configuration.getIcon(); } @NotNull @Override public String getTextFor(T value) { return value.getName(); } }).showInBestPositionFor(dataContext); } }