@NonNull
  private static List<ObservedUri> convertJsonToObservedUris(@NonNull String contentUrisJson) {
    List<ObservedUri> uris = new ArrayList<>();
    try {
      JSONObject json = new JSONObject(contentUrisJson);
      JSONArray jsonFlags = json.getJSONArray(JSON_URI_FLAGS);
      JSONArray jsonUris = json.getJSONArray(JSON_URIS);
      int length = jsonFlags.length();

      for (int i = 0; i < length; i++) {
        int flags = jsonFlags.getInt(i);
        String uri = jsonUris.getString(i);
        uris.add(new ObservedUri(Uri.parse(uri), flags));
      }
    } catch (JSONException e) {
      throw new RuntimeException(e);
    }
    return uris;
  }
JobCoder is a tool to encode and decode JobSpecs from Bundles.
jobdispatcher/src/main/java/com/firebase/jobdispatcher/JobCoder.java