class BookmarkableUrlHelper {

    public static Set<String> getScreensFromPlace(final PlaceRequest place) {
        String url;
        int start;
        int end;
        String docks;

        if (!isNotBlank(place)) {
            return new HashSet<>();
        }
        // get everything after the perspective
        if (isPerspectiveInUrl(place.getFullIdentifier())) {
            String request = place.getFullIdentifier();

            url = request.substring(request.indexOf(PERSPECTIVE_SEP) + 1);
        } else {
            url = place.getFullIdentifier();
        }

        start = url.indexOf(DOCK_BEGIN_SEP);
        end = url.indexOf(DOCK_CLOSE_SEP) + 1;
        if (start > 0) {
            docks = url.substring(start,
                                  end);
            url = url.replace(docks,
                              "");
        }
        // replace the '$' with a comma ','
        url = url.replace(OTHER_SCREEN_SEP,
                          SEPARATOR);
        String[] token = url.split(SEPARATOR);
        return new HashSet<>(Arrays.asList(token));
    }

}