public static SemanticVersion parse(String version) {
        try {
            var matcher = VERSION_PARSE_PATTERN.matcher(version);
            matcher.find();

            var semver = new SemanticVersion();
            semver.setMajor(Integer.parseInt(matcher.group("major")));
            semver.setMinor(Integer.parseInt(matcher.group("minor")));
            semver.setPatch(Integer.parseInt(matcher.group("patch")));
            semver.setPreRelease(matcher.group("prerelease"));
            semver.setBuildMetadata(matcher.group("buildmetadata"));
            return semver;
        } catch (IllegalArgumentException | IllegalStateException e) {
            throw new RuntimeException("Invalid semantic version. See https://semver.org/.");
        }
    }
@Test
    public void testParseInvalidVersion() {
        var exception = assertThrows(RuntimeException.class, () -> SemanticVersion.parse("9.2"));
        assertEquals("Invalid semantic version. See https://semver.org/.", exception.getMessage());
    }