docs: public static JSONObject copy(final JSONObject src, final boolean deep) {
          final JSONObject dest = new JSONObject();
          Iterator<String> keys = src.keys();
          while (keys.hasNext()) {
              final String key = keys.next();
              final Object value = src.opt(key);
              if (deep) {
                  if (value instanceof JSONObject) {
                      safePut(dest, key, copy((JSONObject) value, deep));
                  } else if (value instanceof JSONArray) {
                      safePut(dest, key, copy((JSONArray) value, deep));
                  } else {
                      safePut(dest, key, value);
                  }
              } else {
                  safePut(dest, key, value);
              }
          }
          return dest;
      }