@NonNull
    private static Single<Boolean> changeFavorite(@NonNull final Geocache cache, final boolean add) {
        final String userToken = getUserToken(cache);
        if (StringUtils.isEmpty(userToken)) {
            return Single.just(false);
        }

        final String uri = "https://www.geocaching.com/datastore/favorites.svc/update?u=" + userToken + "&f=" + add;

        return Network.completeWithSuccess(Network.postRequest(uri, null))
            .toSingle(() -> {
                Log.i("GCParser.changeFavorite: cache added/removed to/from favorites");
                return true;
            })
            .onErrorReturn((throwable) -> {
                Log.e("GCParser.changeFavorite: cache not added/removed to/from favorites", throwable);
                return false;
            })
            .map((successful) -> {
                if (successful) {
                    cache.setFavorite(add);
                    cache.setFavoritePoints(cache.getFavoritePoints() + (add ? 1 : -1));
                }
                return successful;
            });
    }
Adds the cache to the favorites of the user.
<br>
This must not be called from the UI thread.

@param cache the cache to add
@return {@code false} if an error occurred, {@code true} otherwise
main/src/main/java/cgeo/geocaching/connector/gc/GCParser.java