}
@Test
public void convertValid() {
Authority template = new AuthorityImpl();
template.setAuthority("FOO");
template.setDefaultForNewUser(true);
template.addUser(new UserImpl("42"));
JpaAuthority jpaTemplate = converter.convert(template);
assertThat(jpaTemplate, is(not(sameInstance(template))));
assertThat(jpaTemplate, is(instanceOf(JpaAuthority.class)));
assertThat(jpaTemplate.getAuthority(), is(equalTo(template.getAuthority())));
assertThat(jpaTemplate.isDefaultForNewUser(), is(equalTo(template.isDefaultForNewUser())));
assertThat(jpaTemplate.getUsers().iterator().next().getId(), is(equalTo(template.getUsers().iterator().next().getId())));
}