code: public JsonElement get(String label) {
          int i = 0;
          try{
              for (JsonElement e : this) {
                  if(e.isPrimitive() && e.asPrimitive().asString().equals(label)) {
                      return e;
                  } else if((e.isObject() || e.isArray())  && Integer.valueOf(label).equals(i)) {
                      return e;
                  }
                  i++;
              }
          } catch(NumberFormatException e) {
              // fail gracefully
              return null;
          }
          // the element was not found
          return null;
      }
docs: Convenient method providing a few alternate ways of extracting elements
  from a JsonArray.
  
  @param label label
  @return the first element in the array matching the label or the n-th
  element if the label is an integer and the element an object or
  an array.