### Question:
TokenUtils { public static String encodeToken(byte[] token) { return new String(Base64.encodeBase64(token)); }  static byte[] getBytesOfToken(Token token); static String[] getGroups(Token token); static Attribute getAttribute(Token token, String attrName); static long getRefreshTime(Token token); static boolean isExpired(Token token); static String encodeToken(byte[] token); static byte[] decodeToken(String token); static Token createTokenInstance(String tokenName, long id, 
      Secrets secrets, String issuer, String user, long issueInstant, 
      long notBefore, long notOnOrAfter, boolean encrypted); static T newInstance(Class<T> theClass, long id, 
      Secrets secrets, String issuer, String user, long issueInstant, 
      long notBefore, long notOnOrAfter, boolean encrypted);  }### Answer:
@Test public void testEncodeToken() throws Exception { byte[] bytes = "hello tokenauth".getBytes(); String encodeString = TokenUtils.encodeToken(bytes); byte[] decodeBytes = TokenUtils.decodeToken(encodeString); assertEquals(new String(decodeBytes, 0, decodeBytes.length), "hello tokenauth"); }