### Question:
ZeroCostModel implements CostModel { public Num calculate(Trade trade) { return calculate(trade, 0); } ZeroCostModel(); Num calculate(Trade trade); Num calculate(Trade trade, int currentIndex); Num calculate(Num price, Num amount); boolean equals(CostModel otherModel);  }### Answer:
@Test public void calculatePerTrade() { ZeroCostModel model = new ZeroCostModel(); int holdingPeriod = 2; Order entry = Order.buyAt(0, DoubleNum.valueOf(100), DoubleNum.valueOf(1), model); Order exit = Order.sellAt(holdingPeriod, DoubleNum.valueOf(110), DoubleNum.valueOf(1), model); Trade trade = new Trade(entry, exit, model, model); Num cost = model.calculate(trade, holdingPeriod); assertNumEquals(cost, DoubleNum.valueOf(0)); }
@Test public void calculatePerPrice() { ZeroCostModel model = new ZeroCostModel(); Num cost = model.calculate(DoubleNum.valueOf(100), DoubleNum.valueOf(1)); assertNumEquals(cost, DoubleNum.valueOf(0)); }