@Override
    public Cost plus(RelOptCost other) {
        Cost other0 = (Cost) other;

        if (isInfinite() || other.isInfinite()) {
            return INFINITY;
        }

        return new Cost(rows + other0.rows, cpu + other0.cpu, network + other0.network);
    }
@Test
    public void testPlus() {
        CostFactory factory = CostFactory.INSTANCE;

        Cost firstCost = factory.makeCost(1.0d, 2.0d, 3.0d);
        Cost secondCost = factory.makeCost(4.0d, 5.0d, 6.0d);
        Cost infiniteCost = factory.makeInfiniteCost();

        assertEquals(factory.makeCost(5.0d, 7.0d, 9.0d), firstCost.plus(secondCost));
        assertEquals(infiniteCost, firstCost.plus(infiniteCost));
    }