code: public boolean replace(JsonElement e1, JsonElement e2) {
          int index = indexOf(e1);
          if(index>=0) {
              set(index, e2);
              return true;
          } else {
              return false;
          }
      }
docs: Replaces the first matching element.
  @param e1 original
  @param e2 replacement
  @return true if the element was replaced.