### Question:
Returns implements Indicator<Num> { public int getSize() { return barSeries.getBarCount() - 1; } Returns(BarSeries barSeries, Trade trade, ReturnType type);  Returns(BarSeries barSeries, TradingRecord tradingRecord, ReturnType type); List<Num> getValues(); @Override Num getValue(int index); @Override BarSeries getBarSeries(); @Override Num numOf(Number number); int getSize(); void calculate(Trade trade); void calculate(Trade trade, int finalIndex);  }### Answer:
@Test public void returnSize() { for (Returns.ReturnType type : Returns.ReturnType.values()) { BarSeries sampleBarSeries = new MockBarSeries(numFunction, 1d, 2d, 3d, 4d, 5d); Returns returns = new Returns(sampleBarSeries, new BaseTradingRecord(), type); assertEquals(4, returns.getSize()); } }