### Question:
AccountService { public void deleteAccount(Long id) { repository.delete(getAccountById(id)); }  boolean isAccountPresent(Long id); Account getAccountById(Long id); List<Account> getAccounts(); Account addAccount(Account account); Account updateAccount(Long id, Account account); void deleteAccount(Long id);  }### Answer:
@Test public void whenDeletingAccountDeleteMethodShouldInvoked() { Account mockAccount = mock(Account.class); Long id = new Long(1); when(repository.findById(id)).thenReturn(Optional.of(mockAccount)); service.deleteAccount(id); verify(repository, times(1)).delete(mockAccount); }