### Question:
JsonWebTokenUtil { public static String issueJwt(String id, String subject, String issuer, Long period, List<String> roles, List<String> permissions, Boolean isRefresh, SignatureAlgorithm algorithm) { long currentTimeMillis = System.currentTimeMillis(); byte[] secretKeyBytes = DatatypeConverter.parseBase64Binary(secretKey); JwtBuilder jwtBuilder = Jwts.builder(); if (id != null) { jwtBuilder.setId(id); } if (subject != null) { jwtBuilder.setSubject(subject); } if (issuer != null) { jwtBuilder.setIssuer(issuer); } jwtBuilder.setIssuedAt(new Date(currentTimeMillis)); if (null != period) { jwtBuilder.setExpiration(new Date(currentTimeMillis + period * 1000)); } if (roles != null) { jwtBuilder.claim("roles", roles); } if (permissions != null) { jwtBuilder.claim("perms", permissions); } if (isRefresh != null) { jwtBuilder.claim("isRefresh", isRefresh); } jwtBuilder.compressWith(CompressionCodecs.DEFLATE); jwtBuilder.signWith(algorithm, secretKeyBytes); return jwtBuilder.compact(); }  static String issueJwt(String id, String subject, String issuer, Long period,
                                  List<String> roles, List<String> permissions,
                                  Boolean isRefresh, SignatureAlgorithm algorithm); static boolean isNotJsonWebToken(String jwt); static Claims parseJwt(String jwt); static void setSecretKey(String secretNowKey);  }### Answer:
@Test public void issueJwt() { String jwt = JsonWebTokenUtil.issueJwt(UUID.randomUUID().toString(), "tom", "token-server", 36000L, Arrays.asList("role2", "rol3"), null, Boolean.FALSE, SignatureAlgorithm.HS512); assertNotNull(jwt); }