### Question:
BerlinGroupLinksRewriter implements LinksRewriter { protected Optional<String> retrieveAuthorisationId(String link) { return findUsingPattern(link, AUTHORISATION_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 retrieveAuthorisationId_success_existsInLink() { String link = "https: Optional<String> actualAuthorisationIdOptional = berlinGroupLinksRewriter.retrieveAuthorisationId(link); assertThat(actualAuthorisationIdOptional).contains(AUTHORISATION_ID); }
@Test void retrieveAuthorisationId_failure_notExistsInLink() { String link = "https: Optional<String> actualAuthorisationIdOptional = berlinGroupLinksRewriter.retrieveAuthorisationId(link); assertThat(actualAuthorisationIdOptional).isNotPresent(); }