@SuppressWarnings("unchecked")
    public static int compare(Comparable lhs, Comparable rhs) {
        assert lhs != null;
        assert rhs != null;

        if (lhs.getClass() == rhs.getClass()) {
            return lhs.compareTo(rhs);
        }

        if (lhs instanceof Number && rhs instanceof Number) {
            return Numbers.compare(lhs, rhs);
        }

        return lhs.compareTo(rhs);
    }
@SuppressWarnings("ConstantConditions")
    @Test(expected = Throwable.class)
    public void testNullLhsInCompareThrows() {
        compare(null, 1);
    }