MavenModuleImportDataWithDependencies (MavenProjectImportData importData) { MavenProject mavenProject = importData.getMavenProject(); List<MavenImportDependency<?>> mainDependencies = new ArrayList<>(mavenProject.getDependencies().size()); List<MavenImportDependency<?>> testDependencies = new ArrayList<>(INITIAL_CAPACITY_TEST_DEPENDENCY_LIST); addMainDependencyToTestModule(importData, testDependencies); boolean hasSeparateTestModule = importData.getSplittedMainAndTestModules() != null; for (MavenArtifact artifact : mavenProject.getDependencies()) { for (MavenImportDependency<?> dependency : getDependency(artifact, mavenProject)) { if (hasSeparateTestModule && dependency.getScope() == DependencyScope.TEST) { testDependencies.add(dependency); } else { mainDependencies.add(dependency); } } } return new MavenModuleImportDataWithDependencies(importData, mainDependencies, testDependencies); }