### Question:
FieldExtractor { public List<String> extractOptionalList(HttpServletRequest request, String fieldName) { try { return xs2aObjectMapper.toJsonGetValuesForField(request.getInputStream(), fieldName); } catch (IOException e) { return Collections.emptyList(); } }  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 extractOptionalList_Success() { List<String> expectedResult = getCurrencyList(); List<String> actualResult = fieldExtractor.extractOptionalList(mockRequest, CURRENCY_FIELD_NAME); assertEquals(expectedResult, actualResult); }
@Test void extractOptionalList_Exception() { List<String> actualResult = fieldExtractor.extractOptionalList(mockedRequest, FIELD_NAME); assertTrue(actualResult.isEmpty()); }