### Question:
CashFlow implements Indicator<Num> { public int getSize() { return barSeries.getBarCount(); } CashFlow(BarSeries barSeries, Trade trade);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord);  CashFlow(BarSeries barSeries, TradingRecord tradingRecord, int finalIndex); @Override Num getValue(int index); @Override BarSeries getBarSeries(); @Override Num numOf(Number number); int getSize();  }### Answer:
@Test public void cashFlowSize() { BarSeries sampleBarSeries = new MockBarSeries(numFunction, 1d, 2d, 3d, 4d, 5d); CashFlow cashFlow = new CashFlow(sampleBarSeries, new BaseTradingRecord()); assertEquals(5, cashFlow.getSize()); }