### Question:
UserServiceImpl implements UserService { @Override @Transactional(readOnly = false) public void delete(Long userId) { final User oldUser = userDao.findOne(userId); oldUser.setPostings(null); userDao.delete(oldUser); }  @Override Page<User> getAllUser(); @Override Page<User> getUser(int skip, int count, Order... order); @Override Page<User> getUser(Pageable page); @Override @Transactional(readOnly = false) User save(User user); @Override User read(Long userId); @Override @Transactional(readOnly = false) void delete(Long userId); @Override long getNrOfUsers(); @Override List<Post> getPostingSelectOptions();  }### Answer:
@Test public void testDelete() { final User user = new User(); when(userDao.findOne(Long.valueOf(1L))).thenReturn(user); userService.delete(Long.valueOf(1L)); verify(userDao, times(1)).delete(user); }