code: public static Object flatten(Object input, JsonLdOptions opts) throws JsonLdError {
          return flatten(input, null, opts);
      }
docs: Flattens the given input and compacts it using the passed context
  according to the steps in the
  <a href="http://www.w3.org/TR/json-ld-api/#flattening-algorithm">
  Flattening algorithm</a>:
  
  @param input
  The input JSON-LD object.
  @param opts
  The {@link JsonLdOptions} that are to be sent to the
  flattening algorithm.
  @return The flattened JSON-LD document
  @throws JsonLdError
  If there is an error while flattening.