DefaultVersionRange implements VersionRange { @Override public boolean containsVersion(Version version) { if (version instanceof DefaultVersion) { return containsVersion((DefaultVersion) version); } else { return containsVersion(new DefaultVersion(version.getValue())); } } DefaultVersionRange(String rawRange);  DefaultVersionRange(Version lowerBound, boolean lowerBoundInclusive, Version upperBound,
        boolean upperBoundInclusive); Version getLowerBound(); Version getUpperBound(); @Override boolean containsVersion(Version version); boolean containsVersion(DefaultVersion version); @Override String getValue(); @Override boolean isCompatible(VersionRange otherRange); boolean isCompatible(DefaultVersionRange otherRange); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); boolean equals(DefaultVersionRange version);  }
@Test void containsVersion() throws InvalidVersionRangeException { assertTrue(new DefaultVersionRange("[1.0,2.0]").containsVersion((Version) new DefaultVersion("1.0"))); assertTrue(new DefaultVersionRange("[1.0,2.0]").containsVersion((Version) new DefaultVersion("2.0"))); assertFalse(new DefaultVersionRange("[2.0]").containsVersion((Version) new DefaultVersion("1.0"))); assertFalse(new DefaultVersionRange("[2.0]").containsVersion((Version) new DefaultVersion("3.0"))); assertFalse(new DefaultVersionRange("(1.0,2.0)").containsVersion((Version) new DefaultVersion("1.0"))); assertFalse(new DefaultVersionRange("(1.0,2.0)").containsVersion((Version) new DefaultVersion("2.0"))); assertTrue(new DefaultVersionRange("[1.0,2.0]").containsVersion(new TestVersion("1.0"))); assertTrue(new DefaultVersionRange("[1.0,2.0]").containsVersion(new TestVersion("2.0"))); assertFalse(new DefaultVersionRange("[2.0]").containsVersion(new TestVersion("1.0"))); assertFalse(new DefaultVersionRange("[2.0]").containsVersion(new TestVersion("3.0"))); assertFalse(new DefaultVersionRange("(1.0,2.0)").containsVersion(new TestVersion("1.0"))); assertFalse(new DefaultVersionRange("(1.0,2.0)").containsVersion(new TestVersion("2.0"))); }