class BookmarkableUrlHelper {

    public static String getUrlToken(final String bookmarkableUrl,
                                     final String screen) {
        int st = isPerspectiveInUrl(bookmarkableUrl) ? (bookmarkableUrl.indexOf(PERSPECTIVE_SEP) + 1) : 0;
        String screensList = bookmarkableUrl.replace(OTHER_SCREEN_SEP,
                                                     SEPARATOR)
                .substring(st,
                           bookmarkableUrl.length());

        String tokens[] = screensList.split(SEPARATOR);
        Optional<String> token = Arrays.asList(tokens).stream()
                .filter(s -> s.contains(screen))
                .findFirst();

        return token.orElse(screen);
    }

}