private static JsonArray getSortedJsonArrayByFinishTime(JsonArray jsonArray) {
    JsonArray sortedJsonArray = new JsonArray();
    List<JsonObject> jsonValues = new ArrayList<JsonObject>();
    for (int i = 0; i < jsonArray.size(); i++) {
      jsonValues.add(jsonArray.get(i).getAsJsonObject());
    }
    Collections.sort(jsonValues, new Comparator<JsonObject>() {
      public int compare(JsonObject a, JsonObject b) {
        Long first = a.get(JsonKeys.FINISH_TIME).getAsLong();
        Long second = b.get(JsonKeys.FINISH_TIME).getAsLong();
        return second.compareTo(first);
      }
    });
    for (JsonObject object : jsonValues) {
      sortedJsonArray.add(object);
    }
    return sortedJsonArray;
  }
This utility method is used to sort the jsonArray based on FinishTime
@param jsonArray The jsonArray to be sorted
@return The sorted jsonArray based on finishtime
app/controllers/api/v1/Web.java