@Test public void testCompareBNodeAndLiteralObjects() { statement1 = valueFactory.createStatement(testSubjectBNode1, testPredicateUri1, testObjectBNode1); statement2 = valueFactory.createStatement(testSubjectBNode1, testPredicateUri1, testObjectLiteral1); assertTrue(testComparator.compare(statement1, statement2) < 0); assertTrue(testComparator.compare(statement2, statement1) > 0); }
@Override public int compare(Statement first, Statement second) { if (first == second) { return EQUAL; } if (first.getSubject().equals(second.getSubject())) { if (first.getPredicate().equals(second.getPredicate())) { if (first.getObject().equals(second.getObject())) { if (first.getContext() == null) { if (second.getContext() == null) { return EQUAL; } else { return BEFORE; } } else if (second.getContext() == null) { return AFTER; } else { return ValueComparator.getInstance().compare(first.getContext(), second.getContext()); } } else { return ValueComparator.getInstance().compare(first.getObject(), second.getObject()); } } else { return ValueComparator.getInstance().compare(first.getPredicate(), second.getPredicate()); } } else { return ValueComparator.getInstance().compare(first.getSubject(), second.getSubject()); } }
StatementComparator implements Comparator<Statement> { @Override public int compare(Statement first, Statement second) { if (first == second) { return EQUAL; } if (first.getSubject().equals(second.getSubject())) { if (first.getPredicate().equals(second.getPredicate())) { if (first.getObject().equals(second.getObject())) { if (first.getContext() == null) { if (second.getContext() == null) { return EQUAL; } else { return BEFORE; } } else if (second.getContext() == null) { return AFTER; } else { return ValueComparator.getInstance().compare(first.getContext(), second.getContext()); } } else { return ValueComparator.getInstance().compare(first.getObject(), second.getObject()); } } else { return ValueComparator.getInstance().compare(first.getPredicate(), second.getPredicate()); } } else { return ValueComparator.getInstance().compare(first.getSubject(), second.getSubject()); } } }
StatementComparator implements Comparator<Statement> { @Override public int compare(Statement first, Statement second) { if (first == second) { return EQUAL; } if (first.getSubject().equals(second.getSubject())) { if (first.getPredicate().equals(second.getPredicate())) { if (first.getObject().equals(second.getObject())) { if (first.getContext() == null) { if (second.getContext() == null) { return EQUAL; } else { return BEFORE; } } else if (second.getContext() == null) { return AFTER; } else { return ValueComparator.getInstance().compare(first.getContext(), second.getContext()); } } else { return ValueComparator.getInstance().compare(first.getObject(), second.getObject()); } } else { return ValueComparator.getInstance().compare(first.getPredicate(), second.getPredicate()); } } else { return ValueComparator.getInstance().compare(first.getSubject(), second.getSubject()); } }  }
StatementComparator implements Comparator<Statement> { @Override public int compare(Statement first, Statement second) { if (first == second) { return EQUAL; } if (first.getSubject().equals(second.getSubject())) { if (first.getPredicate().equals(second.getPredicate())) { if (first.getObject().equals(second.getObject())) { if (first.getContext() == null) { if (second.getContext() == null) { return EQUAL; } else { return BEFORE; } } else if (second.getContext() == null) { return AFTER; } else { return ValueComparator.getInstance().compare(first.getContext(), second.getContext()); } } else { return ValueComparator.getInstance().compare(first.getObject(), second.getObject()); } } else { return ValueComparator.getInstance().compare(first.getPredicate(), second.getPredicate()); } } else { return ValueComparator.getInstance().compare(first.getSubject(), second.getSubject()); } }  static StatementComparator getInstance(); @Override int compare(Statement first, Statement second); }
StatementComparator implements Comparator<Statement> { @Override public int compare(Statement first, Statement second) { if (first == second) { return EQUAL; } if (first.getSubject().equals(second.getSubject())) { if (first.getPredicate().equals(second.getPredicate())) { if (first.getObject().equals(second.getObject())) { if (first.getContext() == null) { if (second.getContext() == null) { return EQUAL; } else { return BEFORE; } } else if (second.getContext() == null) { return AFTER; } else { return ValueComparator.getInstance().compare(first.getContext(), second.getContext()); } } else { return ValueComparator.getInstance().compare(first.getObject(), second.getObject()); } } else { return ValueComparator.getInstance().compare(first.getPredicate(), second.getPredicate()); } } else { return ValueComparator.getInstance().compare(first.getSubject(), second.getSubject()); } }  static StatementComparator getInstance(); @Override int compare(Statement first, Statement second); final static int BEFORE; final static int EQUAL; final static int AFTER; }