### Question:
TradeServiceImpl implements TradeService { @Override public List<Trade> getLastTrades(long[] assetIds) { final TransactionalDataSource dataSource = databaseManager.getDataSource(); return tradeTable.getLastTrades(dataSource, assetIds); } TradeServiceImpl(
        final DatabaseManager databaseManager,
        final Blockchain blockchain,
        final TradeTable tradeTable,
        final IteratorToStreamConverter<Trade> converter
    ); @Inject  TradeServiceImpl(
        final DatabaseManager databaseManager,
        final Blockchain blockchain,
        final TradeTable tradeTable
    ); @Override Stream<Trade> getAllTrades(int from, int to); @Override int getCount(); @Override Trade getTrade(long askOrderId, long bidOrderId); @Override Stream<Trade> getAssetTrades(long assetId, int from, int to); @Override List<Trade> getLastTrades(long[] assetIds); @Override Stream<Trade> getAccountTrades(long accountId, int from, int to); @Override Stream<Trade> getAccountAssetTrades(long accountId, long assetId, int from, int to); @Override Stream<Trade> getAskOrderTrades(long askOrderId, int from, int to); @Override Stream<Trade> getBidOrderTrades(long bidOrderId, int from, int to); @Override int getTradeCount(long assetId); @Override Trade addTrade(long assetId, AskOrder askOrder, BidOrder bidOrder);  }### Answer:
@Test void shouldGetLastTrades() { final long[] assetIds = new long[]{1}; final Trade trade = mock(Trade.class); final TransactionalDataSource dataSource = mock(TransactionalDataSource.class); when(databaseManager.getDataSource()).thenReturn(dataSource); final List<Trade> tradesExpected = List.of(trade); when(tradeTable.getLastTrades(dataSource, assetIds)).thenReturn(tradesExpected); final List<Trade> tradesActual = tradeService.getLastTrades(assetIds); assertEquals(tradesExpected, tradesActual); }