### Question:
BerlinGroupLinksRewriter implements LinksRewriter { protected Optional<String> retrieveAccountId(String link) { return findUsingPattern(link, ACCOUNT_ID_PATTERN); } BerlinGroupLinksRewriter(LinksTemplate linksTemplate,
                                    String host,
                                    String version); void registerPlaceholder(String placeholder,
                                    Function<String, Optional<String>> paramRetriever); @Override Map<String, HrefType> rewrite(Map<String, HrefType> links);  }### Answer:
@Test void retrieveAccountId_success_existsInLink() { String link = "https: Optional<String> actualAccountIdOptional = berlinGroupLinksRewriter.retrieveAccountId(link); assertThat(actualAccountIdOptional).contains(ACCOUNT_ID); }
@Test void retrieveAccountId_failure_notExistsInLink() { String link = "https: Optional<String> actualAccountIdOptional = berlinGroupLinksRewriter.retrieveAccountId(link); assertThat(actualAccountIdOptional).isNotPresent(); }