/** * Remove the exact artifact. The first one found is removed. * * @param id The artifact id * @return {@code true} if the artifact has been removed */ public boolean removeExact(final ArtifactId id) { for (final Artifact artifact : this) { if ( artifact.getId().equals(id)) { return this.remove(artifact); } } return false; }
/** * Remove the same artifact, neglecting the version. The first one found is * removed. * * @param id The artifact id * @return {@code true} if the artifact has been removed */ public boolean removeSame(final ArtifactId id) { for (final Artifact artifact : this) { if ( artifact.getId().isSame(id)) { return this.remove(artifact); } } return false; }