### Question:
GroupId implements Comparable<GroupId> { public static GroupId ofString(String str) { Matcher matcher = VERSION_PATTERN.matcher(str); if (matcher.matches()) { MatchResult result = matcher.toMatchResult(); return GroupId.of( result.group(1), Optional.ofNullable(result.group(2)).map(Integer::parseInt) ); } else { return GroupId.of( str, Optional.empty() ); } }  static GroupId of(String name, int version); static GroupId of(String name, Optional<Integer> version); static GroupId ofString(String str); String asString(); @Override int compareTo(GroupId other); static final Comparator<GroupId> COMPARATOR; static final String VERSION_SEPARATOR; static final Pattern VERSION_PATTERN; }### Answer:
@Test public void testParsing() { assertThat(GroupId.ofString(string)).isEqualTo(object); }