### Question:
JpaAuthorityRepository implements AuthorityRepository { @Override public Authority getByAuthority(String authorityName) { TypedQuery<JpaAuthority> query = manager.createNamedQuery(JpaAuthority.GET_BY_AUTHORITY_NAME, JpaAuthority.class); query.setParameter(JpaAuthority.PARAM_AUTHORITY_NAME, authorityName); return getSingleResult(query.getResultList()); }  @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);  }### Answer:
@Test public void getByAuthorityName() { String authorityName = "administrator"; Authority authority = repository.getByAuthority(authorityName); assertNotNull(authority); assertEquals(authorityName, authority.getAuthority()); assertTrue(authority.getUsers().isEmpty()); }