JpaAccountRepository implements AccountRepository { @Override public void updateAccount(Account account) { entityManager.merge(account); }  @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 testUpdateAccount() throws Exception { Account account = repository.getAccount(1L); BigDecimal current = account.getBalance(); BigDecimal amount = new BigDecimal("50.0"); account.setBalance(current.add(amount)); repository.updateAccount(account); Account again = repository.getAccount(1L); assertThat(again.getBalance(), is(closeTo(current.add(amount), new BigDecimal("0.01")))); }