### Question:
CypherOrderability { public static int compare( Object lhs, Object rhs ) { if ( lhs == rhs ) { return 0; } else if ( lhs == Values.NO_VALUE || lhs == null ) { return 1; } else if ( rhs == Values.NO_VALUE || rhs == null ) { return -1; } else if ( lhs instanceof AnyValue ) { AnyValue rhsValue = (rhs instanceof AnyValue) ? (AnyValue) rhs : ValueUtils.of( rhs ); return AnyValues.COMPARATOR.compare( (AnyValue) lhs, rhsValue ); } else if ( rhs instanceof AnyValue ) { AnyValue lhsValue = ValueUtils.of( lhs ); return AnyValues.COMPARATOR.compare( lhsValue, (AnyValue) rhs ); } SuperType leftType = SuperType.ofValue( lhs ); SuperType rightType = SuperType.ofValue( rhs ); int typeComparison = SuperType.TYPE_ID_COMPARATOR.compare( leftType, rightType ); if ( typeComparison != 0 ) { return typeComparison; } return leftType.comparator.compare( lhs, rhs ); } private  CypherOrderability(); static int compare( Object lhs, Object rhs );  }### Answer:
@Test public void shouldOrderValuesCorrectly() { for ( int i = 2; i < values.length; i++ ) { for ( int j = 2; j < values.length; j++ ) { Object left = values[i]; Object right = values[j]; int cmpPos = sign( i - j ); int cmpVal = sign( compare( left, right ) ); if ( cmpPos != cmpVal ) { throw new AssertionError( format( "Comparing %s against %s does not agree with their positions in the sorted list (%d and " + "%d)", toString( left ), toString( right ), i, j ) ); } } } }