IntentionAction (String actionText) { final List<IntentionAction> intentions = CodeInsightTestFixtureImpl.getAvailableIntentions(myFixture.getEditor(), myFixture.getFile()); final Optional<IntentionAction> maybeIntention = intentions.stream().filter(e -> e.getText().equals(actionText)).findAny(); assert maybeIntention.isPresent() : "The '" + actionText + "' intention hasn't been found among available intentions. Available intentions: " + intentions; return maybeIntention.get(); }