@InterfaceAudience.Private
  @Override
  public Token<?> selectDelegationToken(Credentials creds) {
    Token<?> token = selectDelegationToken(creds, dtService);
    if (token == null) {
      token = selectDelegationToken(creds, canonicalService);
    }
    return token;
  }
@Test
  public void testSelectDelegationToken() throws Exception {
    final Credentials creds = new Credentials();
    creds.addToken(new Text(providerUriString), token);
    assertNull(KMSClientProvider.selectDelegationToken(creds, null));
    assertNull(KMSClientProvider
        .selectDelegationToken(creds, new Text(oldTokenService)));
    assertEquals(token, KMSClientProvider
        .selectDelegationToken(creds, new Text(providerUriString)));
  }