@Test
public void testMapping() {

    roleMappings.put("A", "B");
    authorities.add(new GrantedAuthorityImpl("A"));
    Collection<? extends GrantedAuthority> mapped = mapper.mapAuthorities(authorities);
    assertEquals(1, mapped.size());
    assertEquals("B", mapped.iterator().next().getAuthority());
}