@Test public void emptyTrendIsIndicatedWhenOriginalTrendIsEmpty() { when(original.indicate(any())).thenReturn(Optional.empty()); assertThat(cut.indicate(SOME_PRICE)).isEmpty(); }
@Override public Optional<MarketDirection> indicate(final MP marketPrice) { return original.indicate(marketPrice).map(signal -> signal == UP ? DOWN : UP); }
TrendInverter implements Indicator<MarketDirection, MP> { @Override public Optional<MarketDirection> indicate(final MP marketPrice) { return original.indicate(marketPrice).map(signal -> signal == UP ? DOWN : UP); } }
TrendInverter implements Indicator<MarketDirection, MP> { @Override public Optional<MarketDirection> indicate(final MP marketPrice) { return original.indicate(marketPrice).map(signal -> signal == UP ? DOWN : UP); } TrendInverter(final Indicator<MarketDirection, MP> original); }
TrendInverter implements Indicator<MarketDirection, MP> { @Override public Optional<MarketDirection> indicate(final MP marketPrice) { return original.indicate(marketPrice).map(signal -> signal == UP ? DOWN : UP); } TrendInverter(final Indicator<MarketDirection, MP> original); @Override Optional<MarketDirection> indicate(final MP marketPrice); }
TrendInverter implements Indicator<MarketDirection, MP> { @Override public Optional<MarketDirection> indicate(final MP marketPrice) { return original.indicate(marketPrice).map(signal -> signal == UP ? DOWN : UP); } TrendInverter(final Indicator<MarketDirection, MP> original); @Override Optional<MarketDirection> indicate(final MP marketPrice);  }