### Question:
MongoDbAuthorityRepository implements AuthorityRepository { @Override public List<Authority> getAll() { return CollectionUtils.<Authority>toBaseTypedList(template.findAll(CLASS, AUTHORITY_COLLECTION)); }  @Override Authority getByAuthority(String authorityName); @Override List<Authority> getAll(); @Override List<Authority> getLimitedList(int offset, int limit); @Override List<Authority> getAllDefault(); @Override int getCountAll(); @Override Class<? extends Authority> getType(); @Override Authority get(String id); @Override Authority save(Authority item); @Override void delete(Authority item); void setTemplate(MongoOperations template); void setConverter(HydratingConverterFactory converter); MongoOperations getTemplate(); HydratingConverterFactory getConverter(); static final Class<MongoDbAuthority> CLASS; }### Answer:
@Test public void getAll(){ List<Authority> allAuth = Lists.newLinkedList(); Authority authority = new MongoDbAuthority(); authority.setAuthority("test"); allAuth.add(authority); expect(CollectionUtils.<Authority>toBaseTypedList(template.findAll(CLASS, AUTHORITY_COLLECTION))).andReturn(allAuth); replay(template); List<Authority> result; result = repo.getAll(); assertThat(result.size(), is(1)); assertThat(result.get(0), is(sameInstance(authority))); }