### Question:
DefaultCategoryService implements CategoryService { @Override public Category get(String id) { return categoryRepository.get(id); } @Autowired  DefaultCategoryService(CategoryRepository categoryRepository); @Override Category get(String id); @Override List<Category> getAllList(); @Override SearchResult<Category> getAll(); @Override SearchResult<Category> getLimitedList(int offset, int pageSize); @Override @Transactional Category create(String text, User createdUser); @Override @Transactional Category update(String categoryId, String text, User lastModifiedUser); @Override @Transactional void delete(Category category);  }### Answer:
@Test public void get_validCategoryId() { expect(repository.get(VALID_ID)).andReturn(validCategory); replay(repository); assertThat(service.get(VALID_ID), is(validCategory)); verify(repository); }
@Test public void get_invalidCategoryId() { expect(repository.get(INVALID_ID)).andReturn(null); replay(repository); assertThat(service.get(INVALID_ID), is(nullValue(Category.class))); verify(repository); }