### Question:
UserDao { User read(int id) { return entityManager.find(User.class, id); }    }### Answer:
@Test void readTest() { User user = new User(); user.setName("name"); when(entityManager.find(User.class, user.getId())).thenReturn(user); final User result = userDao.read(user.getId()); Assertions.assertEquals(user, result); }