public boolean matchesAndPreservesGroupArtifactAndType(Dependency dependency) {
        if (!matches(dependency)) {
            return false;
        }
        Dependency transformed = apply(dependency);
        return transformed.getGroupId().equals(dependency.getGroupId())
                && transformed.getArtifactId().equals(dependency.getArtifactId())
                && transformed.getType().equals(dependency.getType());
    }