code: private JSONArray readOptionalArray(JSONObject json, String key) {
  
          try {
              return json.getJSONArray(key);
          } catch (JSONException e) {
              LOG.debug("Reading optional JSON array failed. Default to provided default value.", e);
          }
          return null;
      }
docs: Read an optional JSON array.
  @param json the JSON Object that has the array as element
  @param key the key for the array in the provided JSON object
  @return the array or null if reading the array fails.