MyRunProfile (@NotNull ExecutionEnvironment environment) { final JUnitConfiguration configuration = (JUnitConfiguration)myConsoleProperties.getConfiguration(); final TestMethods testMethods = new TestMethods(configuration, environment, getFailedTests(configuration.getProject())); return new MyRunProfile(configuration) { @Override public Module @NotNull [] getModules() { return testMethods.getModulesToCompile(); } @Override public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) { testMethods.clear(); return testMethods; } }; }