### Question:
MongoDbPortalPreferenceRepository implements PortalPreferenceRepository { @Override public int getCountAll() { return (int)template.count(new Query(), CLASS); }  @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 getCountAll(){ long doubleOseven = 007; expect(template.count(new Query(), preferenceRepository.CLASS)).andReturn(doubleOseven); replay(template); assertThat((int)doubleOseven, is(sameInstance(preferenceRepository.getCountAll()))); }