protected boolean isSameRubyGem(Dependency dependency1, Dependency dependency2) {
        if (dependency1 == null || dependency2 == null
                || !dependency1.getFileName().endsWith(".gemspec")
                || !dependency2.getFileName().endsWith(".gemspec")
                || dependency1.getPackagePath() == null
                || dependency2.getPackagePath() == null) {
            return false;
        }
        return dependency1.getPackagePath().equalsIgnoreCase(dependency2.getPackagePath());
    }
@Test
    public void testIsSameRubyGem() {
        Dependency dependency1 = new Dependency(new File("some.gemspec"), true);
        Dependency dependency2 = new Dependency(new File("another.gemspec"), true);
        dependency1.setPackagePath("path1");
        dependency2.setPackagePath("path2");
        DependencyMergingAnalyzer instance = new DependencyMergingAnalyzer();
        boolean expResult = false;
        boolean result = instance.isSameRubyGem(dependency1, dependency2);
        assertEquals(expResult, result);

        dependency2.setPackagePath("path1");
        expResult = true;
        result = instance.isSameRubyGem(dependency1, dependency2);
        assertEquals(expResult, result);
    }