### Question:
DefaultAuthorityService implements AuthorityService { @Override public SearchResult<Authority> getDefaultAuthorities() { final List<Authority> authorities = repository.getAllDefault(); return new SearchResult<Authority>(authorities, authorities.size()); } @Autowired  DefaultAuthorityService(AuthorityRepository repository); @Override Authority getAuthorityById(String entityId); @Override Authority getAuthorityByName(String authorityName); @Override SearchResult<Authority> getAllAuthorities(); @Override SearchResult<Authority> getDefaultAuthorities();  }### Answer:
@Test public void test_getAllDefault() { List<Authority> authorities = new ArrayList<Authority>(); Authority foo = new AuthorityImpl(); foo.setAuthority("FOO"); foo.setDefaultForNewUser(true); Authority bar = new AuthorityImpl(); bar.setAuthority("BAR"); bar.setDefaultForNewUser(true); authorities.add(foo); authorities.add(bar); expect(repository.getAllDefault()).andReturn(authorities); replay(repository); SearchResult<Authority> defaultAuthorities = service.getDefaultAuthorities(); verify(repository); assertThat(defaultAuthorities.getTotalResults(), is(2)); assertThat(defaultAuthorities.getResultSet().size(), is(2)); }