code: public static boolean sameObject(ObjectNode o1,
                                       String o2,
                                       boolean isLiteral,
                                       URI type,
                                       String lang) {
          if (o1 instanceof URIReference) {
              return sameResource((URIReference) o1, o2);
          } else if (o1 instanceof Literal || isLiteral) {
              return sameLiteral((Literal) o1, o2, type, lang);
          } else {
              return false;
          }
      }
docs: Tells whether the given objects are equivalent, with one given as a set
  of simple values.
  
  @param o1
  first node.
  @param o2
  second node URI (if isLiteral is false) or lexical value (if
  isLiteral is true)
  @param isLiteral
  whether the second node is a literal.
  @param type
  second literal's datatype URI string, if applicable.
  @param lang
  second literal's language tag string, if applicable.
  @return true if equivalent, false otherwise.