### Question:
Version implements Comparable<Version> { public static Version parse(final String version) { int qualifier = version.indexOf("-"); final String[] versions = qualifier > 0 ? version.substring(0, qualifier).split("\\.") : version.split("\\."); try { final int majorVersion = Integer.parseInt(versions[0]); final int minorVersion = versions.length > 1 ? Integer.parseInt(versions[1]) : 0; final int incrementalVersion = versions.length > 2 ? Integer.parseInt(versions[2]) : 0; return new Version( majorVersion, minorVersion, incrementalVersion, qualifier > 0 ? version.substring(qualifier + 1) : null, version ); } catch (NumberFormatException e) { throw new IllegalArgumentException("Invalid version, cannot parse '" + version + "'"); } } Version(final int majorVersion,
                   final int minorVersion,
                   final int incrementalVersion,
                   final String qualifier); private  Version(final int majorVersion,
                    final int minorVersion,
                    final int incrementalVersion,
                    final String qualifier,
                    final String originalVersion); static boolean isEqual(final String v1, final String v2); static boolean isEqual(final Version v1, final String v2); static Version parse(final String version); static Version getLatest(final Version...versions); int majorVersion(); int minorVersion(); int incrementalVersion(); Qualifier qualifier(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override int compareTo(final Version that);  }### Answer:
@Test public void shouldThrowIllegalArgumentGivenInvalidVersion() { IllegalArgumentException e = Assertions.assertThrows( IllegalArgumentException.class, () -> Version.parse("bad input")); Assertions.assertEquals("Invalid version, cannot parse 'bad input'", e.getMessage()); }