VersionRange { public boolean contains(Version version) { return version.compareTo(lowerBound.getSnapshot()) >= 0 && version.compareTo(upperBound.getSnapshot()) < 0; } VersionRange(Version lowerBound, Version upperBound); Version getLowerBound(); Version getUpperBound(); boolean contains(Version version); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void doesNotContainLowerVersion() { assertFalse(range.contains(new Version("1.0.0"))); assertFalse(range.contains(new Version("1.2.2"))); assertFalse(range.contains(new Version("1.1.5"))); }
@Test public void containsLowerBound() { assertTrue(range.contains(new Version("1.2.3"))); }
@Test public void containsVersions() { assertTrue(range.contains(new Version("1.6.0"))); assertTrue(range.contains(new Version("2.0.0"))); assertTrue(range.contains(new Version("2.3.3"))); }
@Test public void doesNotContainUpperBound() { assertFalse(range.contains(new Version("2.3.4"))); }
@Test public void doesNotContainHigherVersions() { assertFalse(range.contains(new Version("2.3.10"))); assertFalse(range.contains(new Version("2.4.0"))); assertFalse(range.contains(new Version("3.0.0"))); }
@Test public void lowerSnapshotInRange() { assertTrue(range.contains(new Version("1.2.3-SNAPSHOT"))); }
@Test public void higherSnapshotOutOfRange() { assertFalse(range.contains(new Version("2.3.4-SNAPSHOT"))); }