### Question:
UserServiceImpl implements UserService { @Override public List<Post> getPostingSelectOptions() { return postDao.findAllOrderByTitle(); }  @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 testGetPostingSelectOptions() { final List<Post> postings = new ArrayList<Post>(); final int numberOfPosts = 5; for (long i = 0; i < numberOfPosts; i++) { Post post = new Post(); post.setId(Long.valueOf(i)); post.setTitle("Title " + i); postings.add(post); } when(postDao.findAllOrderByTitle()).thenReturn(postings); final List<Post> result = userService.getPostingSelectOptions(); assertThat(result).hasSize(numberOfPosts).isEqualTo(postings); }