MockModule (@NotNull String basePath) { MockProject project = createProject(basePath); return new MockModule(project, project) { @Override public @NotNull Path getModuleNioFile() { return Paths.get(project.getBasePath()).resolve("module/module.iml"); } @Override public @SystemIndependent @NotNull String getModuleFilePath() { return basePath + "/module/module.iml"; } }; }