DefaultVersionConstraint implements VersionConstraint { @Override public boolean containsVersion(Version version) { if (getRangesInternal().isEmpty()) { return getVersion() != null && getVersion().equals(version); } else { for (VersionRange range : getRangesInternal()) { if (!range.containsVersion(version)) { return false; } } } return true; } DefaultVersionConstraint(String rawConstraint);  DefaultVersionConstraint(VersionConstraint versionConstraint);  DefaultVersionConstraint(Collection<? extends VersionRangeCollection> ranges, Version version);  DefaultVersionConstraint(Version version); @Override Collection<VersionRangeCollection> getRanges(); @Override Version getVersion(); @Override boolean containsVersion(Version version); @Override boolean isCompatible(Version version); @Override VersionConstraint merge(VersionConstraint versionConstraint); @Override String getValue(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test void containsVersion() { assertTrue(new DefaultVersionConstraint("1.0").containsVersion((Version) new DefaultVersion("1.0"))); assertFalse(new DefaultVersionConstraint("1.0").containsVersion((Version) new DefaultVersion("2.0"))); assertTrue(new DefaultVersionConstraint("1.0").containsVersion(new TestVersion("1.0"))); assertFalse(new DefaultVersionConstraint("1.0").containsVersion(new TestVersion("2.0"))); }