### Question:
B2AccountAuthorizationCache { synchronized B2AccountAuthorization get() throws B2Exception { if (authorization == null) { authorization = accountAuthorizer.authorize(webifier); final String accountIdFromAuthorization = authorization.getAccountId(); if (accountId == null) { accountId = accountIdFromAuthorization; } else { if (!accountId.equals(accountIdFromAuthorization)) { throw new B2LocalException("unauthorized", "authorized as " + accountIdFromAuthorization + "but previously authorized as accountId " + accountId); } } } return authorization; } B2AccountAuthorizationCache(B2StorageClientWebifier webifier,
                                B2AccountAuthorizer accountAuthorizer);   }### Answer:
@Test public void testException() throws B2Exception { final B2Exception e = new B2InternalErrorException("testing", "testing message"); doThrow(e).when(authorizer).authorize(anyObject()); thrown.expect(B2InternalErrorException.class); thrown.expectMessage("testing message"); cache.get(); }