code: @SuppressWarnings("WeakerAccess")
      public static Set<String> getOrderedStringSet(String key, final Set<String> defValue) {
          SharedPreferences prefs = getPreferences();
          if (prefs.contains(key + LENGTH)) {
              LinkedHashSet<String> set = new LinkedHashSet<>();
              int stringSetLength = prefs.getInt(key + LENGTH, -1);
              if (stringSetLength >= 0) {
                  for (int i = 0; i < stringSetLength; i++) {
                      set.add(prefs.getString(key + "[" + i + "]", null));
                  }
              }
              return set;
          }
          return defValue;
      }
docs: Retrieves a Set of Strings as stored by {@link #putOrderedStringSet(String, Set)},
  preserving the original order. Note that this implementation is heavier than the native
  {@link #getStringSet(String, Set)} method (which does not guarantee to preserve order).
  
  @param key      The name of the preference to retrieve.
  @param defValue Value to return if this preference does not exist.
  @return Returns the preference value if it exists, or defValues otherwise.
  @throws ClassCastException if there is a preference with this name that is not a Set of
  Strings.
  @see #getStringSet(String, Set)