docs: static Object removePreserve(Context ctx, Object input, JsonLdOptions opts) throws JsonLdError {
          // recurse through arrays
          if (isArray(input)) {
              final List<Object> output = new ArrayList<Object>();
              for (final Object i : (List<Object>) input) {
                  final Object result = removePreserve(ctx, i, opts);
                  // drop nulls from arrays
                  if (result != null) {
                      output.add(result);
                  }
              }
              input = output;
          } else if (isObject(input)) {
              // remove @preserve
              if (((Map<String, Object>) input).containsKey("@preserve")) {
                  if ("@null".equals(((Map<String, Object>) input).get("@preserve"))) {
                      return null;
                  }
                  return ((Map<String, Object>) input).get("@preserve");
              }
  
              // skip @values
              if (isValue(input)) {
                  return input;
              }
  
              // recurse through @lists
              if (isList(input)) {
                  ((Map<String, Object>) input).put("@list",
                          removePreserve(ctx, ((Map<String, Object>) input).get("@list"), opts));
                  return input;
              }
  
              // recurse through properties
              for (final String prop : ((Map<String, Object>) input).keySet()) {
                  Object result = removePreserve(ctx, ((Map<String, Object>) input).get(prop), opts);
                  final String container = ctx.getContainer(prop);
                  if (opts.getCompactArrays() && isArray(result)
                          && ((List<Object>) result).size() == 1 && container == null) {
                      result = ((List<Object>) result).get(0);
                  }
                  ((Map<String, Object>) input).put(prop, result);
              }
          }
          return input;
      }