code: @NonNull
      public static SharedPreferences.Editor putJson(@NonNull SharedPreferences.Editor editor,
              @NonNull String key, @Nullable Object obj) {
          editor.putString(key, GsonHelper.toJson(obj));
          return editor;
      }
docs: Stores object as json encoded string.
  Gson library should be available in classpath.