InMemoryAccountRepository implements AccountRepository { @Override public Long createAccount(BigDecimal initialBalance) { Long id = nextId++; accountMap.put(id, new Account(id, initialBalance)); return id; }  @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 testCreateAccount() throws Exception { Long id = repository.createAccount(new BigDecimal("250.00")); assertThat(id, is(notNullValue())); Account account = repository.getAccount(id); assertThat(account.getId(), is(id)); assertThat(account.getBalance(), is(closeTo(new BigDecimal("250.0"), new BigDecimal("0.01")))); repository.deleteAccount(id); }