### Question:
AccountService { public Account addAccount(Account account) { return repository.save(account); }  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 whenAddingAccountThenAddedAccountShouldReturn() { Account mockAccount = mock(Account.class); when(mockAccount.getId()).thenReturn(new Long(1)); when(mockAccount.getName()).thenReturn("Sagar Jadhav"); when(repository.save(mockAccount)).thenReturn(mockAccount); assertEquals(mockAccount, service.addAccount(mockAccount)); }