public PomAssert hasDependency(Dependency expected) { String id = generateDependencyId(expected.getGroupId(), expected.getArtifactId()); assertThat(this.dependencies).containsKey(id); Dependency dependency = this.dependencies.get(id); if (expected.getVersion() != null) { assertThat(dependency.getVersion()).isEqualTo(expected.getVersion()); } if (expected.getScope() != null) { assertThat(dependency.getScope()).isEqualTo(expected.getScope()); } if (expected.getType() != null) { assertThat(dependency.getType()).isEqualTo(expected.getType()); } return this; }