IntentionAction (@NotNull Collection<? extends IntentionAction> collection, @NotNull String text) { IntentionAction result = null; for (IntentionAction action : collection) { if (text.equals(action.getText())) { if (result != null) { fail("multiple " + " objects present in collection " + collection); } else { result = action; } } } assertNotNull(" object not found in collection " + collection, result); return result; }