Token implements Writable { @SuppressWarnings("unchecked") public T decodeIdentifier() throws IOException { Class<? extends TokenIdentifier> cls = getClassForIdentifier(getKind()); if (cls == null) { return null; } TokenIdentifier tokenIdentifier = ReflectionUtils.newInstance(cls, null); ByteArrayInputStream buf = new ByteArrayInputStream(identifier); DataInputStream in = new DataInputStream(buf); tokenIdentifier.readFields(in); in.close(); return (T) tokenIdentifier; } Token(T id, SecretManager<T> mgr);  Token(byte[] identifier, byte[] password, Text kind, Text service);  Token();  Token(Token<T> other);  Token(TokenProto tokenPB); Token<T> copyToken(); TokenProto toTokenProto(); byte[] getIdentifier(); @SuppressWarnings("unchecked") T decodeIdentifier(); byte[] getPassword(); synchronized Text getKind(); @InterfaceAudience.Private synchronized void setKind(Text newKind); Text getService(); void setService(Text newService); boolean isPrivate(); boolean isPrivateCloneOf(Text thePublicService); Token<T> privateClone(Text newService); @Override void readFields(DataInput in); @Override void write(DataOutput out); String encodeToUrlString(); void decodeFromUrlString(String newValue); @SuppressWarnings("unchecked") @Override boolean equals(Object right); @Override int hashCode(); @Override String toString(); String buildCacheKey(); boolean isManaged(); long renew(Configuration conf
                    ); void cancel(Configuration conf
                     ); static final Logger LOG; }
@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<TestDelegationTokenIdentifier>(id, secretManager); TokenIdentifier idCopy = token.decodeIdentifier(); assertNotSame(id, idCopy); assertEquals(id, idCopy); }