### Question:
JavaVersion { public static JavaVersion getVersion(String string) { if (string.matches( "[0-9]+\\.[0-9]+\\.[0-9]+-b[0-9]+")) { string = string.replace("-b", ".0."); } if (string.matches( "[0-9]+\\.[0-9]+\\.[0-9]+_[0-9]+-b[0-9]+")) { string = string.replace("-b", "."); } if (string.matches( "[0-9]+\\.[0-9]+\\.[0-9]+_[0-9]+-ea")) { string = string.replace("-ea", "."); } final Matcher matcher = Pattern. compile("[0-9]+\\.[0-9]+[0-9_\\.\\-]+"). matcher(string); if (matcher.find()) { return new JavaVersion(matcher.group()); } else { return null; } } JavaVersion(String string); static JavaVersion getVersion(String string); boolean newerThan(JavaVersion version); boolean newerOrEquals(JavaVersion version); boolean olderThan(JavaVersion version); boolean olderOrEquals(JavaVersion version); long getMajor(); long getMinor(); long getMicro(); long getUpdate(); long getBuild(); String toMinor(); String toJdkStyle();  }### Answer:
@Test public void testJDKUpdateWithU() { assertEquals(JDK.getVersion("1.8.0.29"), JDK.getVersion("1.8.0u29")); }