MavenDomDependency (MavenDomDependencies element) { for (MavenDomDependency dependency : element.getDependencies()) { if (Objects.equals(groupId, dependency.getGroupId().getStringValue()) && Objects.equals(artifactId, dependency.getArtifactId().getStringValue())) { return dependency; } } return null; }