@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 testInvalidBehaviour() {
        String notADateFormatString = "not-a-date-format-string";
        try {
            DateExtractor extractor = new DateExtractor("test","date", notADateFormatString);
            fail("Should have thrown on failing to parse the date format string");
        } catch (PropertyException e) {
            // pass
        }

        String isoFormat = "uuuu-MM-dd";
        DateExtractor extractor = new DateExtractor("test", "date", isoFormat);

        Optional<LocalDate> extractedMetadata = extractor.extractField("definitely-not-a-date");
        assertFalse(extractedMetadata.isPresent());
    }