void (final String testName) { UIUtil.invokeAndWaitIfNeeded(() -> { try { IntentionAction resultAction = null; final List<IntentionAction> actions = myFixture.getAvailableIntentions("intention/testNGJar" + "/" + testName + ".java"); for (IntentionAction action : actions) { if (Comparing.strEqual(action.getText(), "Add testng.jar to classpath")) { resultAction = action; break; } } Assert.assertNotNull(resultAction); } catch (Exception e) { throw new RuntimeException(e); } }); }