@Test
public void testDecodeIdentifier() throws IOException {

  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));
  
  Token<TestDelegationTokenIdentifier> token =
      new Token<>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();
  
  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}