InMemoryAccountRepository implements AccountRepository { @Override public int deleteAccount(Long id) { accountMap.remove(id); return 1; }  @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 testDeleteAccount() throws Exception { int beforeCount = repository.getNumberOfAccounts(); Account account = repository.getAccount(3L); repository.deleteAccount(3L); int afterCount = repository.getNumberOfAccounts(); assertThat(afterCount, is(beforeCount - 1)); repository.createAccount(account.getBalance()); }