### Question:
GithubId { public static Optional<GithubId> fromPlatformId(final String platformId) { final Pattern pattern = Pattern.compile("^(?<owner>.+)\\|FR\\|(?<repo>.+)\\|FR\\|(?<number>\\d+)$"); final Matcher matcher = pattern.matcher(platformId); if (matcher.matches()) { return Optional.of(GithubId.builder() .owner(matcher.group("owner")) .repo(matcher.group("repo")) .number(matcher.group("number")) .build()); } return Optional.empty(); }  static Optional<GithubId> fromString(final String githubIdAsString); static Optional<GithubId> fromPlatformId(final String platformId);  }### Answer:
@Test public void fromPlatformId() { final String owner = "fgagsfgfas"; final String repo = "bdfdb"; final String number = "213"; final Optional<GithubId> result = GithubId.fromPlatformId(String.format("%s|FR|%s|FR|%s", owner, repo, number)); assertThat(result).isPresent() .contains(GithubId.builder().owner(owner).repo(repo).number(number).build()); }
@Test public void fromPlatformId_noMatchEmpty() { final Optional<GithubId> result = GithubId.fromPlatformId("fgagsfgfas|FR|bdfdb|FR"); assertThat(result).isEmpty(); }