### Question:
RegistryAuthenticator { @VisibleForTesting boolean isOAuth2Auth(@Nullable Credential credential) { return credential != null && credential.isOAuth2RefreshToken(); } private  RegistryAuthenticator(
      String realm,
      String service,
      RegistryEndpointRequestProperties registryEndpointRequestProperties,
      @Nullable String userAgent,
      FailoverHttpClient httpClient); Authorization authenticatePull(@Nullable Credential credential); Authorization authenticatePush(@Nullable Credential credential);  }### Answer:
@Test public void isOAuth2Auth_nullCredential() { Assert.assertFalse(registryAuthenticator.isOAuth2Auth(null)); }
@Test public void isOAuth2Auth_basicAuth() { Credential credential = Credential.from("name", "password"); Assert.assertFalse(registryAuthenticator.isOAuth2Auth(credential)); }
@Test public void isOAuth2Auth_oauth2() { Credential credential = Credential.from("<token>", "oauth2_token"); Assert.assertTrue(registryAuthenticator.isOAuth2Auth(credential)); }