docs: public static Map<String, Object> frame(Object input, Object frame, JsonLdOptions opts)
              throws JsonLdError {
  
          if (frame instanceof Map) {
              frame = JsonLdUtils.clone(frame);
          }
          // TODO string/IO input
  
          // 2. Set expanded input to the result of using the expand method using
          // input and options.
          final Object expandedInput = expand(input, opts);
  
          // 3. Set expanded frame to the result of using the expand method using
          // frame and options with expandContext set to null and the
          // frameExpansion option set to true.
          final Object savedExpandedContext = opts.getExpandContext();
          opts.setExpandContext(null);
          opts.setFrameExpansion(true);
          final List<Object> expandedFrame = expand(frame, opts);
          opts.setExpandContext(savedExpandedContext);
  
          // 4. Set context to the value of @context from frame, if it exists, or
          // to a new empty
          // context, otherwise.
          final JsonLdApi api = new JsonLdApi(expandedInput, opts);
          final Context activeCtx = api.context
                  .parse(((Map<String, Object>) frame).get(JsonLdConsts.CONTEXT));
          final List<Object> framed = api.frame(expandedInput, expandedFrame);
          if (opts.getPruneBlankNodeIdentifiers()) {
              JsonLdUtils.pruneBlankNodes(framed);
          }
          Object compacted = api.compact(activeCtx, null, framed, opts.getCompactArrays());
          final Map<String, Object> rval = activeCtx.serialize();
          final boolean addGraph = ((!(compacted instanceof List)) && !opts.getOmitGraph());
          if (addGraph && !(compacted instanceof List)) {
              final List<Object> tmp = new ArrayList<Object>();
              tmp.add(compacted);
              compacted = tmp;
          }
          if (addGraph || (compacted instanceof List)) {
              final String alias = activeCtx.compactIri(JsonLdConsts.GRAPH);
              rval.put(alias, compacted);
          } else if (!addGraph && (compacted instanceof Map)) {
              rval.putAll((Map) compacted);
          }
          JsonLdUtils.removePreserve(activeCtx, rval, opts);
          return rval;
      }