// Path: core/src/main/java/com/github/jsonldjava/core/RDFDataset.java
// public static class Quad extends LinkedHashMap<String, Object> implements Comparable<Quad> {
//     private static final long serialVersionUID = -7021918051975883082L;
// 
//     public Quad(final String subject, final String predicate, final String object,
//             final String graph) {
//         this(subject, predicate,
//                 object.startsWith("_:") ? new BlankNode(object) : new IRI(object), graph);
//     };
// 
//     public Quad(final String subject, final String predicate, final String value,
//             final String datatype, final String language, final String graph) {
//         this(subject, predicate, new Literal(value, datatype, language), graph);
//     };
// 
//     private Quad(final String subject, final String predicate, final Node object,
//             final String graph) {
//         this(subject.startsWith("_:") ? new BlankNode(subject) : new IRI(subject),
//                 new IRI(predicate), object, graph);
//     };
// 
//     public Quad(final Node subject, final Node predicate, final Node object,
//             final String graph) {
//         super();
//         put("subject", subject);
//         put("predicate", predicate);
//         put("object", object);
//         if (graph != null && !"@default".equals(graph)) {
//             // TODO: i'm not yet sure if this should be added or if the
//             // graph should only be represented by the keys in the dataset
//             put("name", graph.startsWith("_:") ? new BlankNode(graph) : new IRI(graph));
//         }
//     }
// 
//     public Node getSubject() {
//         return (Node) get("subject");
//     }
// 
//     public Node getPredicate() {
//         return (Node) get("predicate");
//     }
// 
//     public Node getObject() {
//         return (Node) get("object");
//     }
// 
//     public Node getGraph() {
//         return (Node) get("name");
//     }
// 
//     @Override
//     public int compareTo(Quad o) {
//         if (o == null) {
//             return 1;
//         }
//         int rval = getGraph().compareTo(o.getGraph());
//         if (rval != 0) {
//             return rval;
//         }
//         rval = getSubject().compareTo(o.getSubject());
//         if (rval != 0) {
//             return rval;
//         }
//         rval = getPredicate().compareTo(o.getPredicate());
//         if (rval != 0) {
//             return rval;
//         }
//         return getObject().compareTo(o.getObject());
//     }
// }


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
import com.github.jsonldjava.core.RDFDataset.Quad;

    @Test
    public void compareToDifferentGraph() throws Exception {
        final Quad q2 = new Quad("http://example.com/s1", "http://example.com/p1",
                "http://example.com/o1", "http://example.com/other");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
    public void compareToDifferentSubject() throws Exception {
        final Quad q2 = new Quad("http://example.com/other", "http://example.com/p1",
                "http://example.com/o1", "http://example.com/g1");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
    public void compareToDifferentPredicate() throws Exception {
        final Quad q2 = new Quad("http://example.com/s1", "http://example.com/other",
                "http://example.com/o1", "http://example.com/g1");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
    public void compareToDifferentObject() throws Exception {
        final Quad q2 = new Quad("http://example.com/s1", "http://example.com/p1",
                "http://example.com/other", "http://example.com/g1");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
// Path: core/src/main/java/com/github/jsonldjava/core/RDFDataset.java
// public static class Quad extends LinkedHashMap<String, Object> implements Comparable<Quad> {
//     private static final long serialVersionUID = -7021918051975883082L;
// 
//     public Quad(final String subject, final String predicate, final String object,
//             final String graph) {
//         this(subject, predicate,
//                 object.startsWith("_:") ? new BlankNode(object) : new IRI(object), graph);
//     };
// 
//     public Quad(final String subject, final String predicate, final String value,
//             final String datatype, final String language, final String graph) {
//         this(subject, predicate, new Literal(value, datatype, language), graph);
//     };
// 
//     private Quad(final String subject, final String predicate, final Node object,
//             final String graph) {
//         this(subject.startsWith("_:") ? new BlankNode(subject) : new IRI(subject),
//                 new IRI(predicate), object, graph);
//     };
// 
//     public Quad(final Node subject, final Node predicate, final Node object,
//             final String graph) {
//         super();
//         put("subject", subject);
//         put("predicate", predicate);
//         put("object", object);
//         if (graph != null && !"@default".equals(graph)) {
//             // TODO: i'm not yet sure if this should be added or if the
//             // graph should only be represented by the keys in the dataset
//             put("name", graph.startsWith("_:") ? new BlankNode(graph) : new IRI(graph));
//         }
//     }
// 
//     public Node getSubject() {
//         return (Node) get("subject");
//     }
// 
//     public Node getPredicate() {
//         return (Node) get("predicate");
//     }
// 
//     public Node getObject() {
//         return (Node) get("object");
//     }
// 
//     public Node getGraph() {
//         return (Node) get("name");
//     }
// 
//     @Override
//     public int compareTo(Quad o) {
//         if (o == null) {
//             return 1;
//         }
//         int rval = getGraph().compareTo(o.getGraph());
//         if (rval != 0) {
//             return rval;
//         }
//         rval = getSubject().compareTo(o.getSubject());
//         if (rval != 0) {
//             return rval;
//         }
//         rval = getPredicate().compareTo(o.getPredicate());
//         if (rval != 0) {
//             return rval;
//         }
//         return getObject().compareTo(o.getObject());
//     }
// }


// Path: core/src/test/java/com/github/jsonldjava/core/QuadCompareTest.java
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
import com.github.jsonldjava.core.RDFDataset.Quad;


    @Test
    public void compareToDifferentGraph() throws Exception {
        final Quad q2 = new Quad("http://example.com/s1", "http://example.com/p1",
                "http://example.com/o1", "http://example.com/other");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
    public void compareToDifferentSubject() throws Exception {
        final Quad q2 = new Quad("http://example.com/other", "http://example.com/p1",
                "http://example.com/o1", "http://example.com/g1");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
    public void compareToDifferentPredicate() throws Exception {
        final Quad q2 = new Quad("http://example.com/s1", "http://example.com/other",
                "http://example.com/o1", "http://example.com/g1");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
    public void compareToDifferentObject() throws Exception {
        final Quad q2 = new Quad("http://example.com/s1", "http://example.com/p1",
                "http://example.com/other", "http://example.com/g1");
        assertNotEquals(0, q.compareTo(q2));
    }

    @Test
    public void compareToDifferentObjectType() throws Exception {