class BookmarkableUrlHelper {

    public static String registerCloseEditor(final String currentBookmarkableURLStatus,
                                             final PlaceRequest place) {
        if (place != null
                && place instanceof PathPlaceRequest) {
            final String path = place.getFullIdentifier();
            final String pathWithSep = path.concat(SEPARATOR);

            if (currentBookmarkableURLStatus.contains(pathWithSep)) {
                return currentBookmarkableURLStatus.replace(pathWithSep,
                                                            "");
            }
            return currentBookmarkableURLStatus.replace(path,
                                                        "");
        }
        return currentBookmarkableURLStatus;
    }

}