private static HmacKey createHmacKey(
      String key,
      int tagSizeBytes,
      Variant variant,
      @Nullable Integer idRequirement,
      HashType hashType) {
    try {
      return HmacKey.builder()
          .setKeyBytes(SecretBytes.copyFrom(Hex.decode(key), InsecureSecretKeyAccess.get()))
          .setParameters(
              createHmacParameters(
                  Hex.decode(key).length,
                  tagSizeBytes,
                  variant,
                  hashType))
          .setIdRequirement(idRequirement)
          .build();
    } catch (GeneralSecurityException e) {
      throw new IllegalArgumentException("Incorrect key creation arguments", e);
    }
  }
Creates an {@link HmacParameters} object from the provided {@code keySizeBytes},
{@code fullTagSizeBytes}, {@code variant}, and {@code HashType}. This is a convenience method
that makes the tests code more concise and readable.
java_src/src/main/java/com/google/crypto/tink/mac/internal/HmacTestUtil.java