### Question:
Version implements Comparable<Version> { public static Version from(String version) { String[] fields = version.split("[.-]", 4); checkArgument(fields.length >= 3, "version number is invalid"); return new Version( parseInt(fields[0]), parseInt(fields[1]), parseInt(fields[2]), fields.length == 4 ? fields[3] : null); } private  Version(int major, int minor, int patch, String build); static Version from(String version); static Version from(int major, int minor, int patch, String build); int major(); int minor(); int patch(); String build(); @Override int compareTo(Version that); @Override int hashCode(); @Override boolean equals(Object object); @Override String toString();  }### Answer:
@Test public void testInvalidVersions() { assertIllegalArgument(() -> Version.from("1")); assertIllegalArgument(() -> Version.from("1.0")); assertIllegalArgument(() -> Version.from("1.0-beta1")); assertIllegalArgument(() -> Version.from("1.0.0.0")); assertIllegalArgument(() -> Version.from("1.0.0.0-beta1")); assertIllegalArgument(() -> Version.from("1.0.0-not1")); assertIllegalArgument(() -> Version.from("1.0.0-alpha")); assertIllegalArgument(() -> Version.from("1.0.0-beta")); assertIllegalArgument(() -> Version.from("1.0.0-rc")); }