@Test @SuppressWarnings("unchecked") public void returnsValueOfSmoother() { when(smoother.smooth(any(Price.class))).thenReturn(Optional.empty(), Optional.of(new Price(259)), Optional.of(new Price(924))); assertThat(cut.indicate(SOME_CANDLE)).isEmpty(); assertThat(cut.indicate(SOME_CANDLE)).contains(new Price(259)); assertThat(cut.indicate(SOME_CANDLE)).contains(new Price(924)); }
@Override public Optional<Price> indicate(final MP marketPrice) { return priceSmoother.smooth(marketPrice.getClose()); }
SmoothedPriceIndicator implements Indicator<Price, MP> { @Override public Optional<Price> indicate(final MP marketPrice) { return priceSmoother.smooth(marketPrice.getClose()); } }
SmoothedPriceIndicator implements Indicator<Price, MP> { @Override public Optional<Price> indicate(final MP marketPrice) { return priceSmoother.smooth(marketPrice.getClose()); } SmoothedPriceIndicator(final Smoother<Price> priceSmoother); }
SmoothedPriceIndicator implements Indicator<Price, MP> { @Override public Optional<Price> indicate(final MP marketPrice) { return priceSmoother.smooth(marketPrice.getClose()); } SmoothedPriceIndicator(final Smoother<Price> priceSmoother); @Override Optional<Price> indicate(final MP marketPrice); }
SmoothedPriceIndicator implements Indicator<Price, MP> { @Override public Optional<Price> indicate(final MP marketPrice) { return priceSmoother.smooth(marketPrice.getClose()); } SmoothedPriceIndicator(final Smoother<Price> priceSmoother); @Override Optional<Price> indicate(final MP marketPrice);  }