### Question:
SingleQueryParameterUtils { public static Bytes32 getParameterValueAsBytes32( final Map<String, List<String>> parameterMap, final String key) throws IllegalArgumentException { String stringValue = validateQueryParameter(parameterMap, key); try { return Bytes32.fromHexString(stringValue); } catch (IllegalArgumentException ex) { throw new IllegalArgumentException(INVALID_BYTES32_DATA); } }  static String validateQueryParameter(
      final Map<String, List<String>> parameterMap, final String key); static int getParameterValueAsInt(
      final Map<String, List<String>> parameterMap, final String key); static UInt64 getParameterValueAsUInt64(
      final Map<String, List<String>> parameterMap, final String key); static UInt64 getParameterValueAsEpoch(
      final Map<String, List<String>> parameterMap, final String key); static long getParameterValueAsLong(
      final Map<String, List<String>> parameterMap, final String key); static Bytes32 getParameterValueAsBytes32(
      final Map<String, List<String>> parameterMap, final String key); static BLSSignature getParameterValueAsBLSSignature(
      final Map<String, List<String>> parameterMap, final String key); static final String INVALID_BYTES32_DATA; static final String INVALID_BYTES96_DATA; static final String INVALID_NUMERIC_VALUE; static final String NULL_OR_EMPTY_FORMAT; static final String MUST_SPECIFY_ONLY_ONCE; }### Answer:
@Test public void getParameterAsBytes32_shouldThrowIfCannotParse() { assertThrows( IllegalArgumentException.class, () -> getParameterValueAsBytes32(INVALID_DATA, KEY)); }
@Test public void getParameterAsBytes32_shouldParseHex32String() { Bytes32 bytes32 = Bytes32.random(); Map<String, List<String>> data = Map.of(KEY, List.of(bytes32.toHexString())); Bytes32 result = getParameterValueAsBytes32(data, KEY); assertEquals(bytes32, result); }