public static boolean equal(Comparable lhs, Comparable rhs) {
        assert lhs != null;

        if (rhs == null) {
            return false;
        }

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

        if (lhs instanceof Number lhsNumber && rhs instanceof Number rhsNumber) {
            return Numbers.equal(lhsNumber, rhsNumber);
        }

        return lhs.equals(rhs);
    }
@Test
    public void testEqual() {
        assertFalse(equal(1, null));
        assertFalse(equal(1, 2));
        assertFalse(equal(1, 1.1));
        assertFalse(equal("foo", "bar"));
        assertFalse(equal("foo", 1));
        assertFalse(equal(1.0, "foo"));
        assertFalse(equal(1.0, "1.0"));

        assertTrue(equal(1, 1));
        assertTrue(equal("foo", "foo"));
    }