@Override
    @Nullable
    public Object convert(String value) {
        if (value == null || value.isEmpty()) {
            return null;
        }

        final Parser parser = new Parser(timeZone.toTimeZone());
        final List<DateGroup> r = parser.parse(value);

        if (r.isEmpty() || r.get(0).getDates().isEmpty()) {
            return null;
        }

        return new DateTime(r.get(0).getDates().get(0), timeZone);
    }
@Test
    public void testConvert() throws Exception {
        Converter c = new FlexibleDateConverter(Collections.<String, Object>emptyMap());

        assertNull(c.convert(null));
        assertEquals(null, c.convert(""));
        assertEquals(null, c.convert("foo"));

        // Using startsWith here to avoid time zone problems in tests.
        assertTrue(c.convert("2014-3-12").toString().startsWith("2014-03-12T"));
        assertTrue(c.convert("2014-3-12 12:27").toString().startsWith("2014-03-12T12:27:00.000"));
        assertTrue(c.convert("Mar 12").toString().contains("-03-12T"));
        assertTrue(c.convert("Mar 12 2pm").toString().contains("-03-12T14:00:00.000"));
        assertTrue(c.convert("Mar 12 14:45:38").toString().contains("-03-12T14:45:38.000"));
        assertTrue(c.convert("Mar 2 13:48:18").toString().contains("-03-02T13:48:18.000"));
    }