### Question:
VersionRange { public boolean isExact() { if (empty) { return false; } else if (ceilingVersion == null) { return true; } if (isFloorInclusive) { if (isCeilingInclusive) { return floorVersion.equals(ceilingVersion); } else { Version adjacent1 = new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion .getMicro(), floorVersion.getRevision() + 1); return adjacent1.compareTo(ceilingVersion) >= 0; } } else { if (isCeilingInclusive) { Version adjacent1 = new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion .getMicro(), floorVersion.getRevision() + 1); return adjacent1.equals(ceilingVersion); } else { Version adjacent2 = new Version(floorVersion.getMajor(), floorVersion.getMinor(), floorVersion .getMicro(), floorVersion.getRevision() + 2); return adjacent2.compareTo(ceilingVersion) >= 0; } } } VersionRange(Version low, boolean isLowInclusive, Version high, boolean isHighInclusive); static VersionRange parse(String range); Version getFloor(); boolean isFloorInclusive(); Version getCeiling(); boolean isCeilingInclusive(); boolean isInRange(Version version); boolean isExact(); boolean isEmpty(); boolean equals(Object obj); @Override int hashCode(); String toString(); static final char LEFT_OPEN; static final char LEFT_CLOSED; static final char RIGHT_OPEN; static final char RIGHT_CLOSED; }### Answer:
@Test public void testIsExact() throws Exception { Assert.assertTrue(VersionRange.parse("1.1.0.0").isExact()); Assert.assertTrue(VersionRange.parse(" [ 1 , 1 ] ").isExact()); Assert.assertTrue(VersionRange.parse("[ 1.1 , 1.1 ]").isExact()); Assert.assertTrue(VersionRange.parse(" [1.1.1 , 1.1.1] ").isExact()); Assert.assertTrue(VersionRange.parse("[1.1.0.0,1.1.0.0]").isExact()); Assert.assertTrue(VersionRange.parse("(1.1.0.0,1.1.0.2)").isExact()); }
@Test public void testIsExact() throws Exception { assertTrue(VersionRange.parse("1.1.0.0").isExact()); assertTrue(VersionRange.parse(" [ 1 , 1 ] ").isExact()); assertTrue(VersionRange.parse("[ 1.1 , 1.1 ]").isExact()); assertTrue(VersionRange.parse(" [1.1.1 , 1.1.1] ").isExact()); assertTrue(VersionRange.parse("[1.1.0.0,1.1.0.0]").isExact()); assertTrue(VersionRange.parse("(1.1.0.0,1.1.0.2)").isExact()); }