RunProfileState (Location<PsiMethod> @NotNull [] testMethods, Module module, RunConfiguration configuration, ExecutionEnvironment environment) { JUnitConfiguration.Data data = ((JUnitConfiguration)configuration).getPersistentData(); data.setPatterns(collectMethodPatterns(testMethods)); data.TEST_OBJECT = JUnitConfiguration.TEST_PATTERN; Map<Module, Module> toRoot = splitModulesIntoChunks(testMethods, module); return new TestsPattern((JUnitConfiguration)configuration, environment) { @Override protected boolean forkPerModule() { return module == null; } @Override protected void fillForkModule(Map<Module, List<String>> perModule, Module module, String name) { super.fillForkModule(perModule, toRoot.get(module), name); } }; }