### Question:
FieldExtractor { public List<String> extractList(HttpServletRequest request, String fieldName, MessageError messageError) { List<String> fieldList = new ArrayList<>(); try { fieldList.addAll(xs2aObjectMapper.toJsonGetValuesForField(request.getInputStream(), fieldName)); } catch (IOException e) { errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_DESERIALIZATION_FAIL)); } return fieldList; }  Optional<String> extractField(HttpServletRequest request, String fieldName, MessageError messageError); Optional<String> extractOptionalField(HttpServletRequest request, String fieldName); List<String> extractList(HttpServletRequest request, String fieldName, MessageError messageError); List<String> extractOptionalList(HttpServletRequest request, String fieldName); Optional<T> mapBodyToInstance(HttpServletRequest request, MessageError messageError, Class<T> clazz);  }### Answer:
@Test void extractList_Success() { List<String> expectedResult = getCurrencyList(); List<String> actualResult = fieldExtractor.extractList(mockRequest, CURRENCY_FIELD_NAME, messageError); assertEquals(expectedResult, actualResult); assertTrue(messageError.getTppMessages().isEmpty()); }
@Test void extractList_Exception() { List<String> actualResult = fieldExtractor.extractList(mockedRequest, FIELD_NAME, messageError); assertTrue(actualResult.isEmpty()); assertEquals(DESERIALIZATION_ERROR, messageError); }