### Question:
MongoDbCategoryRepository implements CategoryRepository { @Override public List<Category> getLimitedList(int offset, int limit) { return CollectionUtils.<Category>toBaseTypedList(hydrate(template.find(new Query().skip(offset).limit(limit), CLASS))); }  @Override List<Category> getAll(); @Override List<Category> getLimitedList(int offset, int limit); @Override int getCountAll(); @Override int removeFromCreatedOrModifiedFields(String userId); @Override Class<? extends Category> getType(); @Override Category get(String id); @Override Category save(Category item); @Override void delete(Category item); void setTemplate(MongoOperations template); void setConverter(HydratingConverterFactory converter); static final Class<MongoDbCategory> CLASS; }### Answer:
@Test public void getLimitedList(){ int offset = 234; int pageSize = 123; List<MongoDbCategory> found = new ArrayList<MongoDbCategory>(); Query q = new Query().skip(offset).limit(pageSize); expect(template.find(q, categoryRepository.CLASS)).andReturn(found); replay(template); assertThat(CollectionUtils.<Category>toBaseTypedList(found), is(sameInstance(categoryRepository.getLimitedList(offset, pageSize)))); }