// Path: reactivefb/src/main/java/com/beltaief/reactivefb/util/Logger.java
// public final class Logger {
// 
//     private static boolean DEBUG = false;
//     private static boolean DEBUG_WITH_STACKTRACE = false;
// 
//     private Logger() {
//     }
// 
//     public static <T> void logInfo(Class<T> cls, String message) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.i(tag, "-----");
//             Log.i(tag, LogType.INFO + ": " + message);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.i(tag, getStackTrace());
//             }
//         }
//     }
// 
//     public static <T> void logWarning(Class<T> cls, String message) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.w(tag, "-----");
//             Log.w(tag, LogType.WARNING + ": " + message);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.w(tag, getStackTrace());
//             }
//         }
//     }
// 
//     public static <T> void logError(Class<T> cls, String message) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.e(tag, "-----");
//             Log.e(tag, LogType.ERROR + ": " + message);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.e(tag, getStackTrace());
//             }
//         }
//     }
// 
//     public static <T> void logError(Class<T> cls, String message, Throwable e) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.e(tag, "-----");
//             Log.e(tag, LogType.ERROR + ": " + message, e);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.e(tag, getStackTrace());
//             }
//         }
//     }
// 
//     private enum LogType {
//         INFO,
//         WARNING,
//         ERROR
//     }
// 
//     private static String getStackTrace() {
//         StringWriter sw = new StringWriter();
//         PrintWriter pw = new PrintWriter(sw);
//         new Throwable().printStackTrace(pw);
//         return sw.toString();
//     }
// }
// 
// Path: reactivefb/src/main/java/com/beltaief/reactivefb/util/Utils.java
// public final class Utils {
//     private Utils() {
//     }
// 
//     public static Bundle getBundle(String mFields, int limit) {
//         Bundle bundle = new Bundle();
//         if (mFields != null) {
//             bundle.putString("fields", mFields);
//         }
//         if (limit > 0) {
//             bundle.putString("limit", String.valueOf(limit));
//         }
//         return bundle;
//     }
// 
//     @SuppressWarnings("resource")
//     public static String encode(String key, String data) {
//         try {
//             Mac mac = Mac.getInstance("HmacSHA256");
//             SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(), "HmacSHA256");
//             mac.init(secretKey);
//             byte[] bytes = mac.doFinal(data.getBytes());
//             StringBuilder sb = new StringBuilder(bytes.length * 2);
//             Formatter formatter = new Formatter(sb);
//             for (byte b : bytes) {
//                 formatter.format("%02x", b);
//             }
//             return sb.toString();
//         } catch (Exception e) {
//             Logger.logError(Utils.class, "Failed to create sha256", e);
//             return null;
//         }
//     }
// }


import com.beltaief.reactivefb.util.Logger;
import com.beltaief.reactivefb.util.Utils;
import com.google.gson.annotations.SerializedName;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collection;
        /**
         * Validates that the allowed / denied lists can be accessed.<br/>
         * In case you use a predefined privacy setting different than
         * {@link Privacy.PrivacySettings#CUSTOM CUSTOM}, you <b>must not</b> use the
         * custom lists.
         */
        private void validateListsAccessRequest() {
            if (mPrivacySetting != PrivacySettings.CUSTOM) {
                Logger.logWarning(Privacy.class, "Can't add / delete from allowed / " +
                        "denied lists when privacy setting is different than \"CUSTOM\"");

                mPrivacySetting = PrivacySettings.CUSTOM;
            }
        }

    }

    /**
     * Returns the {@code JSON} representation that should be used as the value
     * of the privacy parameter<br/>
     * in the entities that have privacy settings.
     *
     * @return A {@code String} representing the value of the privacy parameter
     */
    public String getJSONString() {
        JSONObject jsonRepresentation = new JSONObject();
        try {
            jsonRepresentation.put(PRIVACY, mPrivacySetting.name());
            if (mPrivacySetting == PrivacySettings.CUSTOM) {
                if (!mAllowedUsers.isEmpty()) {
// Path: reactivefb/src/main/java/com/beltaief/reactivefb/util/Logger.java
// public final class Logger {
// 
//     private static boolean DEBUG = false;
//     private static boolean DEBUG_WITH_STACKTRACE = false;
// 
//     private Logger() {
//     }
// 
//     public static <T> void logInfo(Class<T> cls, String message) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.i(tag, "-----");
//             Log.i(tag, LogType.INFO + ": " + message);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.i(tag, getStackTrace());
//             }
//         }
//     }
// 
//     public static <T> void logWarning(Class<T> cls, String message) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.w(tag, "-----");
//             Log.w(tag, LogType.WARNING + ": " + message);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.w(tag, getStackTrace());
//             }
//         }
//     }
// 
//     public static <T> void logError(Class<T> cls, String message) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.e(tag, "-----");
//             Log.e(tag, LogType.ERROR + ": " + message);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.e(tag, getStackTrace());
//             }
//         }
//     }
// 
//     public static <T> void logError(Class<T> cls, String message, Throwable e) {
//         if (DEBUG || DEBUG_WITH_STACKTRACE) {
//             String tag = cls.getName();
//             Log.e(tag, "-----");
//             Log.e(tag, LogType.ERROR + ": " + message, e);
// 
//             if (DEBUG_WITH_STACKTRACE) {
//                 Log.e(tag, getStackTrace());
//             }
//         }
//     }
// 
//     private enum LogType {
//         INFO,
//         WARNING,
//         ERROR
//     }
// 
//     private static String getStackTrace() {
//         StringWriter sw = new StringWriter();
//         PrintWriter pw = new PrintWriter(sw);
//         new Throwable().printStackTrace(pw);
//         return sw.toString();
//     }
// }
// 
// Path: reactivefb/src/main/java/com/beltaief/reactivefb/util/Utils.java
// public final class Utils {
//     private Utils() {
//     }
// 
//     public static Bundle getBundle(String mFields, int limit) {
//         Bundle bundle = new Bundle();
//         if (mFields != null) {
//             bundle.putString("fields", mFields);
//         }
//         if (limit > 0) {
//             bundle.putString("limit", String.valueOf(limit));
//         }
//         return bundle;
//     }
// 
//     @SuppressWarnings("resource")
//     public static String encode(String key, String data) {
//         try {
//             Mac mac = Mac.getInstance("HmacSHA256");
//             SecretKeySpec secretKey = new SecretKeySpec(key.getBytes(), "HmacSHA256");
//             mac.init(secretKey);
//             byte[] bytes = mac.doFinal(data.getBytes());
//             StringBuilder sb = new StringBuilder(bytes.length * 2);
//             Formatter formatter = new Formatter(sb);
//             for (byte b : bytes) {
//                 formatter.format("%02x", b);
//             }
//             return sb.toString();
//         } catch (Exception e) {
//             Logger.logError(Utils.class, "Failed to create sha256", e);
//             return null;
//         }
//     }
// }


// Path: app/src/main/java/com/beltaief/reactivefbexample/models/Privacy.java
import com.beltaief.reactivefb.util.Logger;
import com.beltaief.reactivefb.util.Utils;
import com.google.gson.annotations.SerializedName;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Collection;

        /**
         * Validates that the allowed / denied lists can be accessed.<br/>
         * In case you use a predefined privacy setting different than
         * {@link Privacy.PrivacySettings#CUSTOM CUSTOM}, you <b>must not</b> use the
         * custom lists.
         */
        private void validateListsAccessRequest() {
            if (mPrivacySetting != PrivacySettings.CUSTOM) {
                Logger.logWarning(Privacy.class, "Can't add / delete from allowed / " +
                        "denied lists when privacy setting is different than \"CUSTOM\"");

                mPrivacySetting = PrivacySettings.CUSTOM;
            }
        }

    }

    /**
     * Returns the {@code JSON} representation that should be used as the value
     * of the privacy parameter<br/>
     * in the entities that have privacy settings.
     *
     * @return A {@code String} representing the value of the privacy parameter
     */
    public String getJSONString() {
        JSONObject jsonRepresentation = new JSONObject();
        try {
            jsonRepresentation.put(PRIVACY, mPrivacySetting.name());
            if (mPrivacySetting == PrivacySettings.CUSTOM) {
                if (!mAllowedUsers.isEmpty()) {
                    jsonRepresentation.put(ALLOW, Utils.join(mAllowedUsers.iterator(), ","));