private static int validateAesKeySize(int sizeInBytes) throws InvalidAlgorithmParameterException {
    if (sizeInBytes != 16 && sizeInBytes != 32) {
      throw new InvalidAlgorithmParameterException(
          String.format("Invalid AES key size, expected 16 or 32, but got %d", sizeInBytes));
    }
    return sizeInBytes;
  }
@throws InvalidAlgorithmParameterException if {@code sizeInBytes} is not supported.
java_src/src/main/java/com/google/crypto/tink/aead/subtle/AesGcmFactory.java