@Test
public void testToken() throws Exception {

  Token identityToken = createToken(null, identityTokenName);
  byte[] tokenBytes = TokenUtils.getBytesOfToken(identityToken);
  System.out.println(tokenBytes.length);
  Token resultToken = TokenFactory.get().createIdentityToken(tokenBytes);
  System.out.println("ID: " + resultToken.getId());
  System.out.println("Principal :" + resultToken.getPrincipal().getName());
  System.out.print("Attribute : {");
  for (Attribute attr : resultToken.getAttributes()) {
    System.out.print(attr.getName() + " ");
  }
  System.out.println("}");
  System.out.println("CreationTime: " + resultToken.getCreationTime());
  System.out.println("ExpiryTime: " + resultToken.getExpiryTime());
  assertEquals(resultToken.getPrincipal().getName(), DEFAULT_PRINCIAL_NAME);
}