### Question:
TokenAuthRealm extends AuthorizingRealm { @Override protected AuthorizationInfo doGetAuthorizationInfo(final PrincipalCollection principalCollection) { final Object primaryPrincipal = principalCollection.getPrimaryPrincipal(); final ODLPrincipal odlPrincipal; try { odlPrincipal = (ODLPrincipal) primaryPrincipal; return new SimpleAuthorizationInfo(odlPrincipal.getRoles()); } catch (ClassCastException e) { LOG.error("Couldn't decode authorization request", e); } return new SimpleAuthorizationInfo(); } TokenAuthRealm();   }### Answer:
@Test(expected = NullPointerException.class) public void testDoGetAuthorizationInfoPrincipalCollectionNullCacheToken() { testRealm.doGetAuthorizationInfo(null); }