void (String sources, Module module, Disposable parentDisposable) { VirtualFile contentRoot = getContentRoot(sources); ModuleRootModificationUtil.updateModel(module, model -> { ContentEntry contentEntry = model.addContentEntry(contentRoot); contentEntry.addSourceFolder(contentRoot.getUrl() + "/src", false); CompilerModuleExtension moduleExtension = model.getModuleExtension(CompilerModuleExtension.class); moduleExtension.inheritCompilerOutputPath(false); moduleExtension.setCompilerOutputPath(contentRoot.findFileByRelativePath("out/production")); }); Sdk jdk9 = IdeaTestUtil.getMockJdk9(); WriteAction.runAndWait(()-> ProjectJdkTable.getInstance().addJdk(jdk9, parentDisposable)); ModuleRootModificationUtil.setModuleSdk(module, jdk9); }