### Question:
OzoneDelegationTokenSelector extends AbstractDelegationTokenSelector<OzoneTokenIdentifier> { @Override public Token<OzoneTokenIdentifier> selectToken(Text service, Collection<Token<? extends TokenIdentifier>> tokens) { if (LOG.isTraceEnabled()) { LOG.trace("Getting token for service {}", service); } Token token = getSelectedTokens(service, tokens); if (LOG.isDebugEnabled()) { LOG.debug("Got tokens: {} for service {}", token, service); } return token; } OzoneDelegationTokenSelector(); @Override Token<OzoneTokenIdentifier> selectToken(Text service,
      Collection<Token<? extends TokenIdentifier>> tokens);  }### Answer:
@Test public void testTokenSelector() { byte[] identifier = RandomStringUtils.randomAlphabetic(10) .getBytes(StandardCharsets.UTF_8); byte[] password = RandomStringUtils.randomAlphabetic(10) .getBytes(StandardCharsets.UTF_8); Token<OzoneTokenIdentifier> tokenIdentifierToken = new Token<>(identifier, password, KIND_NAME, getService()); OzoneDelegationTokenSelector ozoneDelegationTokenSelector = new OzoneDelegationTokenSelector(); Text service = new Text("om1:9862"); Token<OzoneTokenIdentifier> selectedToken = ozoneDelegationTokenSelector.selectToken(service, Collections.singletonList(tokenIdentifierToken)); Assert.assertNotNull(selectedToken); tokenIdentifierToken.setService(new Text("om1:9863")); selectedToken = ozoneDelegationTokenSelector.selectToken(service, Collections.singletonList(tokenIdentifierToken)); Assert.assertNull(selectedToken); service = new Text("om1:9863"); selectedToken = ozoneDelegationTokenSelector.selectToken(service, Collections.singletonList(tokenIdentifierToken)); Assert.assertNotNull(selectedToken); }