### Question:
AdWordsSession implements AdsSession, OAuth2Compatible { public void setOAuth2Credential(Credential oAuth2Credential) { Preconditions.checkNotNull(oAuth2Credential, "oAuth2Credential cannot be null."); clearAuthentication(); this.oAuth2Credential = oAuth2Credential; } private  AdWordsSession(Builder builder); String getClientCustomerId(); void setClientCustomerId(String clientCustomerId); @Nullable Boolean isValidateOnly(); void setValidateOnly(@Nullable Boolean isValidateOnly); String getUserAgent(); String getDeveloperToken(); @Nullable Boolean isPartialFailure(); void setPartialFailure(@Nullable Boolean isPartialFailure); @Override Credential getOAuth2Credential(); void setOAuth2Credential(Credential oAuth2Credential); @Nullable ReportingConfiguration getReportingConfiguration(); void setReportingConfiguration(@Nullable ReportingConfiguration reportingConfiguration); @Override String getEndpoint(); Builder newBuilder(); static final String DEFAULT_ENDPOINT; }### Answer:
@Test public void testSetAuthentication_null() throws Exception { AdWordsSession adWordsSession = build( new AdWordsSession.Builder() .withUserAgent("FooBar") .withEndpoint("https: .withOAuth2Credential(credential) .withDeveloperToken("developerToken")); if (isImmutable) { thrown.expect(UnsupportedOperationException.class); } else { thrown.expect(NullPointerException.class); } thrown.expectMessage("oAuth2Credential"); adWordsSession.setOAuth2Credential(null); }