docs: public static List<Object> expand(Object input, JsonLdOptions opts) throws JsonLdError {
          // 1)
          // TODO: look into java futures/promises
  
          // 2) TODO: better verification of DOMString IRI
          if (input instanceof String && ((String) input).contains(":")) {
              try {
                  final RemoteDocument tmp = opts.getDocumentLoader().loadDocument((String) input);
                  input = tmp.getDocument();
                  // TODO: figure out how to deal with remote context
              } catch (final Exception e) {
                  throw new JsonLdError(Error.LOADING_DOCUMENT_FAILED, e);
              }
              // if set the base in options should override the base iri in the
              // active context
              // thus only set this as the base iri if it's not already set in
              // options
              if (opts.getBase() == null) {
                  opts.setBase((String) input);
              }
          }
  
          // 3)
          Context activeCtx = new Context(opts);
          // 4)
          if (opts.getExpandContext() != null) {
              Object exCtx = opts.getExpandContext();
              if (exCtx instanceof Map
                      && ((Map<String, Object>) exCtx).containsKey(JsonLdConsts.CONTEXT)) {
                  exCtx = ((Map<String, Object>) exCtx).get(JsonLdConsts.CONTEXT);
              }
              activeCtx = activeCtx.parse(exCtx);
          }
  
          // 5)
          // TODO: add support for getting a context from HTTP when content-type
          // is set to a jsonld compatable format
  
          // 6)
          Object expanded = new JsonLdApi(opts).expand(activeCtx, input);
  
          // final step of Expansion Algorithm
          if (expanded instanceof Map && ((Map) expanded).containsKey(JsonLdConsts.GRAPH)
                  && ((Map) expanded).size() == 1) {
              expanded = ((Map<String, Object>) expanded).get(JsonLdConsts.GRAPH);
          } else if (expanded == null) {
              expanded = new ArrayList<Object>();
          }
  
          // normalize to an array
          if (!(expanded instanceof List)) {
              final List<Object> tmp = new ArrayList<Object>();
              tmp.add(expanded);
              expanded = tmp;
          }
          return (List<Object>) expanded;
      }