### Question:
TokenUtils { public static String[] getGroups(Token token) { if(token == null) { throw new NullPointerException("Token can not be null."); } List<Attribute> attributes = token.getAttributes(); if(attributes != null) { for(Attribute attribute : attributes) { if(attribute.getName().equalsIgnoreCase(Attribute.GROUPS)) { Set<String> groups = attribute.getValues(String.class); return groups != null ? groups.toArray( new String[groups.size()]) : new String[0]; } } } return new String[0]; }  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 testGetGroups() throws Exception { Token identityToken = createToken(null, identityTokenName); String[] groups = TokenUtils.getGroups(identityToken); for (String g : groups) { System.out.println(g); } }