TradeInfoService { public Collection<Trade<M, N, K>> getAllTrades() { lock.readLock().lock(); try { Collection<Trade<M, N, K>> trades = Lists.newArrayList(); for (K accId : this.tradesCache.keySet()) { trades.addAll(getTradesForAccount(accId)); } return trades; } finally { lock.readLock().unlock(); } } TradeInfoService(TradeManagementProvider<M, N, K> tradeManagementProvider,
			AccountDataProvider<K> accountDataProvider); Collection<K> findAllAccountsWithInstrumentTrades(TradeableInstrument<N> instrument); @PostConstruct void init(); int findNetPositionCountForCurrency(String currency); Collection<Trade<M, N, K>> getAllTrades(); Collection<Trade<M, N, K>> getTradesForAccountAndInstrument(K accountId, TradeableInstrument<N> instrument); Collection<Trade<M, N, K>> getTradesForAccount(K accountId); void refreshTradesForAccount(K accountId); boolean isTradeExistsForInstrument(TradeableInstrument<N> instrument);  }
@Test public void allTradesTest() { TradeInfoService<Long, String, Long> service = createService(); Collection<Trade<Long, String, Long>> allTrades = service.getAllTrades(); assertEquals(7, allTrades.size()); }