void () { Runnable runnable = () -> { myFixture.addClass("package org.testng.annotations;\n" + "public @interface AfterSuite { java.lang.String[] dependsOnMethods() default {};}"); myFixture.addClass("package org.testng.annotations;\n" + "public @interface BeforeMethod { java.lang.String[] dependsOnMethods() default {};}"); myFixture.addClass("package org.testng.annotations;\n" + "public @interface Test { java.lang.String[] dependsOnMethods() default {};}"); myFixture.testHighlighting(true, false, false, "Dependencies.java"); }; UIUtil.invokeAndWaitIfNeeded(runnable); }