### Question:
DatableFromYearPropertyParser implements PropertyParser { @Override public String parse(String value) { if (value == null) { return null; } Datable datable = deserializeDatable(value); return datable.isValid() ? String.valueOf(datable.getFromYear()) : null; }  @Override String parse(String value); @Override Comparable<?> parseForSort(String value);  }### Answer:
@Test public void parseReturnsTheFromYearAsAStringFromAValidDatable() { String validDatableString = "\"2015-05-01\""; String result = instance.parse(validDatableString); assertThat(result, is("2015")); }
@Test public void parseReturnsNullIfTheDatableIsNotValid() { String invalidDatableString = "hello world"; String result = instance.parse(invalidDatableString); assertThat(result, is(nullValue())); }