@Test
public void removeFromPomIfNecessaryTest() {

    String groupId = "groupId";
    String artifactId = "artifactId";
    String version = "version";
    GAV toRemove = new GAV(groupId, artifactId, version);
    Dependencies dependencies = new Dependencies();
    dependencies.add(new Dependency(toRemove));
    assertTrue(service.removeFromPomIfNecessary(dependencies, toRemove));
    assertFalse(service.removeFromPomIfNecessary(dependencies, toRemove));
    dependencies.add(new Dependency(new GAV(groupId, artifactId, null)));
    assertTrue(service.removeFromPomIfNecessary(dependencies, toRemove));
    assertFalse(service.removeFromPomIfNecessary(dependencies, toRemove));
}