@InterfaceAudience.Private
  static Token<AuthenticationTokenIdentifier> toToken(AuthenticationProtos.Token proto) {
    return new Token<>(proto.hasIdentifier() ? proto.getIdentifier().toByteArray() : null,
      proto.hasPassword() ? proto.getPassword().toByteArray() : null,
      AuthenticationTokenIdentifier.AUTH_TOKEN_TYPE,
      proto.hasService() ? new Text(proto.getService().toStringUtf8()) : null);
  }
Converts a protobuf Token message back into a Token instance.
@param proto the protobuf Token message
@return the Token instance
hbase-client/src/main/java/org/apache/hadoop/hbase/security/token/ClientTokenUtil.java