### Question:
DexTradingDataService { public List<SimpleTradingEntry> getFromCandlesticks(int fromTimestamp, int toTimestamp, DexCurrency currency, TimeFrame timeFrame) { int prevTime = ceilTo(timeFrame, fromTimestamp); List<DexCandlestick> candlesticks = candlestickDao.getForTimespan(prevTime, toTimestamp, currency); List<SimpleTradingEntry> entries = candlesticks.stream().map(this::fromCandleStick).collect(Collectors.toList()); return getResultData(entries, timeFrame, prevTime, toTimestamp); } @Inject  DexTradingDataService(@Property("apl.dex.graph.enableDataFeeder") boolean enableTradingViewGraphDataFeeder,
                                 @Property("apl.dex.graph.enableDataCache") boolean enableTradingDataCache,
                                 DexCandlestickDao candlestickDao,
                                 DexOrderDao orderDao);  DexTradingDataService(boolean enableTradingViewGraphDataFeeder,
                                 boolean enableTradingDataCache,
                                 DexCandlestickDao candlestickDao,
                                 DexOrderDao orderDao,
                                 int orderSelectLimit); List<SimpleTradingEntry> getFromCandlesticks(int fromTimestamp, int toTimestamp, DexCurrency currency, TimeFrame timeFrame); TradingDataOutput getBars(int fromTimestamp, int toTimestamp, DexCurrency currency, TimeFrame timeFrame); int getLastCandlestickTimestamp(DexCurrency currency); List<SimpleTradingEntry> getForTimeFrameFromDexOrders(int fromTimestamp, int toTimestamp, DexCurrency currency, TimeFrame timeFrame);  }### Answer:
@Test void testGetForTimeFrameFromCandlesticksFor1HTimeFrame() { int fromTimestamp = 1574848800; int toTimestamp = 1574863200; List<DexCandlestick> candlesticks = List.of(td.ETH_0_CANDLESTICK, td.ETH_1_CANDLESTICK, td.ETH_2_CANDLESTICK, td.ETH_3_CANDLESTICK, td.ETH_4_CANDLESTICK, td.ETH_5_CANDLESTICK, td.ETH_6_CANDLESTICK, td.ETH_7_CANDLESTICK, td.ETH_8_CANDLESTICK); doReturn(candlesticks).when(candlestickDao).getForTimespan(fromTimestamp, toTimestamp, DexCurrency.ETH); List<SimpleTradingEntry> tradingEntries = service.getFromCandlesticks(fromTimestamp, toTimestamp, DexCurrency.ETH, TimeFrame.HOUR); List<SimpleTradingEntry> expected = List.of( fromRawData("0.0000032", "0.0000041", "0.0000034", "0.0000039", "1559000", "1114.9034283", 1574848800), fromRawData("0.0000031", "0.0000043", "0.0000039", "0.0000034", "2447800", "1579.469088", 1574852400), fromRawData("0.0000031", "0.0000036", "0.0000035", "0.0000033", "945246", "636.790145", 1574856000), fromRawData("0.0000025", "0.0000036", "0.0000033", "0.0000031", "3464000", "2254.168052", 1574859600) ); assertEquals(expected, tradingEntries); }