void (@NotNull List<? extends PsiLiteralExpression> targets, @NotNull Consumer<? super List<? extends PsiLiteralExpression>> selectionConsumer) { if (targets.size() == 1) { selectionConsumer.consume(targets); } else { JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<PsiLiteralExpression>( JavaBundle.message("highlight.suppressed.warnings.choose.inspections"), targets) { @Override public PopupStep<?> onChosen(PsiLiteralExpression selectedValue, boolean finalChoice) { selectionConsumer.consume(Collections.singletonList(selectedValue)); return FINAL_CHOICE; } @Override public @NotNull String getTextFor(PsiLiteralExpression value) { Object o = value.getValue(); LOG.assertTrue(o instanceof String); return (String)o; } }).showInBestPositionFor(myEditor); } }