### Question:
VersionRange implements IComparable <VersionRange> { @Nonnull public String getAsString () { return getAsString (Version.DEFAULT_PRINT_ZERO_ELEMENTS); } 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 testGetAsString () { final String [] aTrueTests = new String [] { "[1.2.3]", "(1.2.3)", "[1.2)", "(3.4]", "[12,12]", "(1,4]", "[1.2.3,4.5.6)", "(47.11.0.alpha,58]", "[1.2.3,1.2.3]", VersionRange.DEFAULT_VERSION_RANGE_STRING }; for (final String element : aTrueTests) { final VersionRange vr = VersionRange.parse (element); assertEquals (vr.getAsString (), element); } final String [] aFalseTests = new String [] { " 1", "1.2.3", "[1.2.3, 4.5]", "00" }; for (final String element : aFalseTests) { final VersionRange vr = VersionRange.parse (element); assertFalse (vr.getAsString ().equals (element)); } }