### Question:
UserDao { void update(User user) { entityManager.merge(user); }    }### Answer:
@Test void updateTest() { User user = new User(); when(entityManager.merge(user)).thenReturn(null); userDao.update(user); Mockito.verify(entityManager).merge(user); }