### Question:
AuthenticationFactoryImpl implements AuthenticationFactory { @Override public AuthMechanism instanceAuthMechanism(final IRODSAccount irodsAccount) throws AuthUnavailableException, JargonException { log.debug("instanceAuthMechanism()"); if (irodsAccount == null) { throw new IllegalArgumentException("null or blank irodsAccount"); } AuthScheme authScheme; if (irodsAccount.getUserName().equals(IRODSAccount.PUBLIC_USERNAME)) { log.debug("account is anonymous, use default auth scheme"); authScheme = AuthScheme.STANDARD; } else { authScheme = irodsAccount.getAuthenticationScheme(); } log.debug("authScheme:{}", authScheme); if (authScheme.equals(AuthScheme.STANDARD)) { log.debug("using standard auth"); return new StandardIRODSAuth(); } else if (authScheme.equals(AuthScheme.PAM)) { log.debug("using PAM auth"); return new PAMAuth(); } else if (authScheme.equals(AuthScheme.GSI)) { log.debug("using standard auth"); return new GSIAuth(); } else { throw new AuthUnavailableException("auth method not avaialble for:" + authScheme); } }  @Override AuthMechanism instanceAuthMechanism(final IRODSAccount irodsAccount);  }### Answer:
@Test(expected = IllegalArgumentException.class) public final void testInstanceNullMechanism() throws Exception { AuthenticationFactory authenticationFactory = new AuthenticationFactoryImpl(); authenticationFactory.instanceAuthMechanism(null); }