code: public String replaceJSONPathElement(String jsonString, String key, String value) {
          return JsonPath.parse(jsonString).set(key, value).jsonString();
      }
docs: The function searches over the array by certain field value,
  and replaces occurences with the parameter provided.
  
  @param jsonString Original json object
  @param key        Key to search
  @param value      Value to replace key with