@Test public void parseReturnsNullIfTheDatableIsNotValid() { String invalidDatableString = "hello world"; String result = instance.parse(invalidDatableString); assertThat(result, is(nullValue())); }
@Override public String parse(String value) { if (value == null) { return null; } Datable datable = deserializeDatable(value); return datable.isValid() ? String.valueOf(datable.getFromYear()) : null; }
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; } }
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; }  }
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); }
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);  }