### Question:
UserDao { void delete(int id) { User user = read(id); entityManager.remove(user); }    }### Answer:
@Test void deleteTest() { User user = new User(); when(entityManager.find(User.class, user.getId())).thenReturn(user); userDao.delete(user.getId()); Mockito.verify(entityManager).remove(user); }