### Question:
ValueComparator implements Comparator<Value> { @Override public int compare(Value o1, Value o2) { if (ObjectUtil.nullEquals(o1, o2)) { return 0; } if (o1 == null) { return -1; } if (o2 == null) { return 1; } boolean b1 = o1 instanceof BNode; boolean b2 = o2 instanceof BNode; if (b1 && b2) { return compareBNodes((BNode) o1, (BNode) o2); } if (b1) { return -1; } if (b2) { return 1; } boolean u1 = o1 instanceof IRI; boolean u2 = o2 instanceof IRI; if (u1 && u2) { return compareURIs((IRI) o1, (IRI) o2); } if (u1) { return -1; } if (u2) { return 1; } return compareLiterals((Literal) o1, (Literal) o2); }  @Override int compare(Value o1, Value o2);  }### Answer:
@Test public void testBothNull() throws Exception { assertTrue(cmp.compare(null, null) == 0); }
@Test public void testLeftNull() throws Exception { assertTrue(cmp.compare(null, typed1) < 0); }
@Test public void testRightNull() throws Exception { assertTrue(cmp.compare(typed1, null) > 0); }
@Test public void testBothBnode() throws Exception { assertTrue(cmp.compare(bnode1, bnode1) == 0); assertTrue(cmp.compare(bnode2, bnode2) == 0); assertTrue(cmp.compare(bnode1, bnode2) != cmp.compare(bnode2, bnode1)); assertTrue(cmp.compare(bnode1, bnode2) == -1 * cmp.compare(bnode2, bnode1)); }
@Test public void testLeftBnode() throws Exception { assertTrue(cmp.compare(bnode1, typed1) < 0); }
@Test public void testRightBnode() throws Exception { assertTrue(cmp.compare(typed1, bnode1) > 0); }
@Test public void testBothURI() throws Exception { assertTrue(cmp.compare(uri1, uri1) == 0); assertTrue(cmp.compare(uri1, uri2) < 0); assertTrue(cmp.compare(uri1, uri3) < 0); assertTrue(cmp.compare(uri2, uri1) > 0); assertTrue(cmp.compare(uri2, uri2) == 0); assertTrue(cmp.compare(uri2, uri3) < 0); assertTrue(cmp.compare(uri3, uri1) > 0); assertTrue(cmp.compare(uri3, uri2) > 0); assertTrue(cmp.compare(uri3, uri3) == 0); }
@Test public void testLeftURI() throws Exception { assertTrue(cmp.compare(uri1, typed1) < 0); }
@Test public void testRightURI() throws Exception { assertTrue(cmp.compare(typed1, uri1) > 0); }