### Question:
VersionRange implements IComparable <VersionRange> { @Nonnull public static VersionRange parse (@Nullable final String sVersionString) { final String s = sVersionString == null ? "" : sVersionString.trim (); if (s.length () == 0) { return new VersionRange (Version.DEFAULT_VERSION, true, null, false); } Version aFloorVersion; boolean bIncludeFloor; Version aCeilVersion; boolean bIncludeCeil; int i = 0; if (s.charAt (i) == '[') { bIncludeFloor = true; i++; } else if (s.charAt (i) == '(') { bIncludeFloor = false; i++; } else bIncludeFloor = true; int j = 0; if (StringHelper.endsWith (s, ']')) { bIncludeCeil = true; j++; } else if (StringHelper.endsWith (s, ')')) { bIncludeCeil = false; j++; } else bIncludeCeil = false; final int nRestLen = s.length () - i - j; if (nRestLen == 0) { aFloorVersion = Version.DEFAULT_VERSION; aCeilVersion = null; } else { final String [] parts = StringHelper.getExplodedArray (',', s.substring (i, s.length () - j)); final String sFloor = parts[0].trim (); final String sCeiling = parts.length > 1 ? parts[1].trim () : null; aFloorVersion = Version.parse (sFloor); if (StringHelper.hasNoText (sCeiling)) aCeilVersion = null; else aCeilVersion = Version.parse (sCeiling); } if (aCeilVersion != null && aFloorVersion.compareTo (aCeilVersion) > 0) throw new IllegalArgumentException ("Floor version may not be greater than the ceiling version!"); return new VersionRange (aFloorVersion, bIncludeFloor, aCeilVersion, bIncludeCeil); } VersionRange(@Nonnull final Version aFloorVersion, @Nullable final Version aCeilingVersion);  VersionRange(@Nonnull final Version aFloorVersion,
                       final boolean bIncludeFloorVersion,
                       @Nullable final Version aCeilingVersion,
                       final boolean bIncludeCeilingVersion); @Nonnull static VersionRange parse(@Nullable final String sVersionString); boolean isIncludingFloor(); @Nullable Version getFloorVersion(); boolean isIncludingCeil(); @Nullable Version getCeilVersion(); boolean versionMatches(@Nonnull final Version rhs); int compareTo(@Nonnull final VersionRange rhs); @Nonnull String getAsString(); @Nonnull String getAsString(final boolean bPrintZeroElements); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); static final String DEFAULT_VERSION_RANGE_STRING; }### Answer:
@Test public void testCtor2 () { new VersionRange (Version.parse ("1.0"), Version.parse ("2.0")); try { new VersionRange (null, Version.parse ("2.0")); fail (); } catch (final NullPointerException ex) {} try { new VersionRange (Version.parse ("2.1"), Version.parse ("2.0")); fail (); } catch (final IllegalArgumentException ex) {} }