@Override
    public boolean equals(Object other) {
        if (other instanceof Cost) {
            return equals((RelOptCost) other);
        }

        return false;
    }
@Test
    public void testEquals() {
        CostFactory factory = CostFactory.INSTANCE;

        checkEquals(factory.makeCost(1.0d, 2.0d, 3.0d), factory.makeCost(1.0d, 2.0d, 3.0d), true);

        checkEquals(factory.makeCost(1.0d, 2.0d, 3.0d), factory.makeCost(10.0d, 2.0d, 3.0d), false);

        checkEquals(factory.makeCost(1.0d, 2.0d, 3.0d), factory.makeCost(1.0d, 10.0d, 3.0d), false);
        checkEquals(factory.makeCost(1.0d, 2.0d, 3.0d), factory.makeCost(1.0d, Double.POSITIVE_INFINITY, 3.0d), false);

        checkEquals(factory.makeCost(1.0d, 2.0d, 3.0d), factory.makeCost(1.0d, 2.0d, 10.0d), false);
        checkEquals(factory.makeCost(1.0d, 2.0d, 3.0d), factory.makeCost(1.0d, 2.0d, Double.POSITIVE_INFINITY), false);
    }