code: private static Mac initHmacSha256(byte[] key) {
          try {
              SecretKeySpec keySpec = new SecretKeySpec(key, MAC_ALGORITHM);
              Mac mac = Mac.getInstance(MAC_ALGORITHM);
              mac.init(keySpec);
              return mac;
          }
          catch (GeneralSecurityException e) {
              throw new IllegalArgumentException(e);
          }
      }
docs: Initializes a {@link Mac} object using the given key.
  
  @param key the HMAC key.
  @return the initialized Mac object.
  @throws IllegalArgumentException if the provided key is invalid.