docs: private static URLEntity[] getURLEntitiesFromJSON(JSONObject json, String category) throws JSONException, TwitterException {
          if (!json.isNull("entities")) {
              JSONObject entitiesJSON = json.getJSONObject("entities");
              if (!entitiesJSON.isNull(category)) {
                  JSONObject descriptionEntitiesJSON = entitiesJSON.getJSONObject(category);
                  if (!descriptionEntitiesJSON.isNull("urls")) {
                      JSONArray urlsArray = descriptionEntitiesJSON.getJSONArray("urls");
                      int len = urlsArray.length();
                      URLEntity[] urlEntities = new URLEntity[len];
                      for (int i = 0; i < len; i++) {
                          urlEntities[i] = new URLEntityJSONImpl(urlsArray.getJSONObject(i));
                      }
                      return urlEntities;
                  }
              }
          }
          return new URLEntity[0];
      }