class BookmarkableUrlHelper {

    public static String registerClosedDock(String currentBookmarkableURLStatus,
                                            UberfireDock targetDock) {
        if (!isNotBlank(currentBookmarkableURLStatus)
                || null == targetDock) {
            return currentBookmarkableURLStatus;
        }
        final String id = getDockId(targetDock);
        final String closed = CLOSED_DOCK_PREFIX.concat(id);
        if (!currentBookmarkableURLStatus.contains(closed)) {
            return currentBookmarkableURLStatus.replace(id,
                                                        CLOSED_DOCK_PREFIX.concat(id));
        }
        return currentBookmarkableURLStatus;
    }

}