protected Dependency getMainSwiftDependency(Dependency dependency1, Dependency dependency2) {
        if (dependency1 != null && dependency2 != null
                && Ecosystem.IOS.equals(dependency1.getEcosystem())
                && Ecosystem.IOS.equals(dependency2.getEcosystem())
                && isSameSwiftPackage(dependency1, dependency2)) {
            if (dependency1.getFileName().endsWith(".podspec")) {
                return dependency1;
            }
            return dependency2;
        }
        return null;
    }
@Test
    public void testGetMainSwiftDependency() {

        Dependency dependency1 = null;
        Dependency dependency2 = null;
        DependencyMergingAnalyzer instance = new DependencyMergingAnalyzer();
        Dependency expResult = null;
        Dependency result = instance.getMainSwiftDependency(dependency1, dependency2);
        assertEquals(expResult, result);

        dependency1 = new Dependency(new File("some.podspec"), true);
        dependency1.setEcosystem(Ecosystem.IOS);
        dependency1.setPackagePath("path");
        dependency2 = new Dependency(new File("Package.swift"), true);
        dependency2.setEcosystem(Ecosystem.IOS);
        dependency2.setPackagePath("path");
        expResult = dependency1;
        result = instance.getMainSwiftDependency(dependency1, dependency2);
        assertEquals(expResult, result);

        dependency1 = new Dependency(new File("Package.swift"), true);
        dependency1.setEcosystem(Ecosystem.IOS);
        dependency1.setPackagePath("path");
        dependency2 = new Dependency(new File("some.podspec"), true);
        dependency2.setEcosystem(Ecosystem.IOS);
        dependency2.setPackagePath("path");
        expResult = dependency2;
        result = instance.getMainSwiftDependency(dependency1, dependency2);
        assertEquals(expResult, result);
    }