### Question:
PostServiceImpl implements PostService { @Override public long getNrOfPosts() { return postDao.count(); }  @Override Page<Post> getPost(Pageable page); @Override @Transactional(readOnly = false) Post save(Post post); @Override Post read(Long postId); @Override @Transactional(readOnly = false) void delete(Long postId); @Override long getNrOfPosts(); @Override List<User> getAllUsers(); @Override List<Tag> getAllActiveTags();  }### Answer:
@SuppressWarnings("boxing") @Test public void testNrOfPosts() { final long nrOfPost = 10; when(postDao.count()).thenReturn(nrOfPost); long testValue = postService.getNrOfPosts(); verify(postDao, times(1)).count(); assertThat(testValue).isEqualTo(nrOfPost); }