@Override
    public Cost multiplyBy(double factor) {
        if (isInfinite()) {
            return INFINITY;
        }

        return new Cost(rows * factor, cpu * factor, network * factor);
    }
@Test
    public void testMultiply() {
        CostFactory factory = CostFactory.INSTANCE;

        Cost originalCost = factory.makeCost(1.0d, 2.0d, 3.0d);
        Cost multipliedCost = factory.makeCost(3.0d, 6.0d, 9.0d);
        assertEquals(multipliedCost, originalCost.multiplyBy(3.0d));

        Cost infiniteCost = factory.makeInfiniteCost();
        assertEquals(infiniteCost, infiniteCost.multiplyBy(3.0d));
    }