### Question:
MongoDbPortalPreferenceRepository implements PortalPreferenceRepository { @Override public List<PortalPreference> getAll() { return CollectionUtils.<PortalPreference>toBaseTypedList(template.findAll(CLASS, PREFERENCE_COLLECTION)); }  @Override List<PortalPreference> getAll(); @Override List<PortalPreference> getLimitedList(int offset, int pageSize); @Override int getCountAll(); @Override PortalPreference getByKey(String key); @Override Class<? extends PortalPreference> getType(); @Override PortalPreference get(String id); @Override PortalPreference save(PortalPreference item); @Override void delete(PortalPreference item); void setTemplate(MongoOperations template); void setConverter(HydratingConverterFactory converter); static final Class<PortalPreferenceImpl> CLASS; }### Answer:
@Test public void getAll_Valid(){ List<PortalPreferenceImpl> found = new ArrayList<PortalPreferenceImpl>(); expect(template.findAll(preferenceRepository.CLASS, CollectionNames.PREFERENCE_COLLECTION)).andReturn(found); replay(template); assertThat(CollectionUtils.<PortalPreference>toBaseTypedList(found), is(sameInstance(preferenceRepository.getAll()))); }