docs: public static String generateTokenString(String jsonResName, Set<InvalidClaims> invalidClaims, Map<String, Long> timeClaims) throws Exception {
          if (invalidClaims == null) {
              invalidClaims = Collections.emptySet();
          }
          InputStream contentIS = TokenUtils.class.getResourceAsStream(jsonResName);
          byte[] tmp = new byte[4096];
          int length = contentIS.read(tmp);
          byte[] content = new byte[length];
          System.arraycopy(tmp, 0, content, 0, length);
  
          JSONParser parser = new JSONParser(DEFAULT_PERMISSIVE_MODE);
          JSONObject jwtContent = (JSONObject) parser.parse(content);
          // Change the issuer to INVALID_ISSUER for failure testing if requested
          if (invalidClaims.contains(InvalidClaims.ISSUER)) {
              jwtContent.put(Claims.iss.name(), "INVALID_ISSUER");
          }
          long currentTimeInSecs = currentTimeInSecs();
          long exp = currentTimeInSecs + 300;
          jwtContent.put(Claims.iat.name(), currentTimeInSecs);
          jwtContent.put(Claims.auth_time.name(), currentTimeInSecs);
          // If the exp claim is not updated, it will be an old value that should be seen as expired
          if (!invalidClaims.contains(InvalidClaims.EXP)) {
              jwtContent.put(Claims.exp.name(), exp);
          }
          if (timeClaims != null) {
              timeClaims.put(Claims.iat.name(), currentTimeInSecs);
              timeClaims.put(Claims.auth_time.name(), currentTimeInSecs);
              timeClaims.put(Claims.exp.name(), exp);
          }
  
          PrivateKey pk;
          if (invalidClaims.contains(InvalidClaims.SIGNER)) {
              // Generate a new random private key to sign with to test invalid signatures
              KeyPair keyPair = generateKeyPair(2048);
              pk = keyPair.getPrivate();
          } else {
              // Use the test private key associated with the test public key for a valid signature
              pk = readPrivateKey("/privateKey.pem");
          }
  
          // Create RSA-signer with the private key
          JWSSigner signer = new RSASSASigner(pk);
          JWTClaimsSet claimsSet = JWTClaimsSet.parse(jwtContent);
          JWSAlgorithm alg = JWSAlgorithm.RS256;
          if (invalidClaims.contains(InvalidClaims.ALG)) {
              alg = JWSAlgorithm.HS256;
              SecureRandom random = new SecureRandom();
              BigInteger secret = BigInteger.probablePrime(256, random);
              signer = new MACSigner(secret.toByteArray());
          }
          JWSHeader jwtHeader = new JWSHeader.Builder(alg)
                          .keyID("/privateKey.pem")
                          .type(JOSEObjectType.JWT)
                          .build();
          SignedJWT signedJWT = new SignedJWT(jwtHeader, claimsSet);
          signedJWT.sign(signer);
          String jwt = signedJWT.serialize();
          return jwt;
      }