InMemoryAccountRepository implements AccountRepository { @Override public List<Account> getAccounts() { Collection<Account> accountCollection = accountMap.values(); List<Account> accountList = new ArrayList<Account>(); for (Account account : accountCollection) { accountList.add(account); } return accountList; }  @Override List<Account> getAccounts(); @Override Account getAccount(Long id); @Override int getNumberOfAccounts(); @Override Long createAccount(BigDecimal initialBalance); @Override int deleteAccount(Long id); @Override void updateAccount(Account account);  }
@Test public void testGetAccounts() throws Exception { List<Account> accounts = repository.getAccounts(); assertThat(accounts.size(), is(3)); }