@Override
    protected Optional<LocalDate> extractField(String s) {
        try {
            return Optional.of(LocalDate.parse(s, formatter));
        } catch (DateTimeParseException e) {
            logger.log(Level.WARNING, e.getParsedString());
            logger.log(Level.WARNING, String.format("Unable to parse date %s with formatter %s", s, formatter.toString()));
            return Optional.empty();
        }
    }
@Test
    public void testValidBehaviour() {
        String isoFormat = "uuuu-MM-dd";
        DateTimeFormatter isoFormatter = DateTimeFormatter.ofPattern(isoFormat, Locale.US);
        String isoInput = "1994-01-26";
        DateExtractor isoExtractor = new DateExtractor("test-iso", "date-iso", isoFormat);
        LocalDate isoDate = LocalDate.parse(isoInput, isoFormatter);
        Optional<LocalDate> isoExtracted = isoExtractor.extractField(isoInput);
        assertTrue(isoExtracted.isPresent());
        assertEquals(isoDate,isoExtracted.get());

        String usFormat = "MM-dd-uuuu";
        DateTimeFormatter usFormatter = DateTimeFormatter.ofPattern(usFormat, Locale.US);
        String usInput = "09-08-1966";
        DateExtractor usExtractor = new DateExtractor("test-us", "date-us", usFormat);
        LocalDate usDate = LocalDate.parse(usInput, usFormatter);
        Optional<LocalDate> usExtracted = usExtractor.extractField(usInput);
        assertTrue(usExtracted.isPresent());
        assertEquals(usDate,usExtracted.get());

        String ukFormat = "dd-MM-uuuu";
        DateTimeFormatter ukFormatter = DateTimeFormatter.ofPattern(ukFormat, Locale.US);
        String ukInput = "23-11-1963";
        DateExtractor ukProc = new DateExtractor("test-uk", "date-uk", ukFormat);
        LocalDate ukDate = LocalDate.parse(ukInput, ukFormatter);
        Optional<LocalDate> ukExtracted = ukProc.extractField(ukInput);
        assertTrue(ukExtracted.isPresent());
        assertEquals(ukDate,ukExtracted.get());
    }