@Test public void parseForSortReturnsAnIntegerValueTheFromYearOfTheDatable() { String validDatableString = "\"2015-05-01\""; Object result = instance.parseForSort(validDatableString); assertThat(result, is(2015)); }
@Override public Comparable<?> parseForSort(String value) { if (value == null) { return null; } Datable datable = deserializeDatable(value); return datable.isValid() ? datable.getFromYear() : null; }
DatableFromYearPropertyParser implements PropertyParser { @Override public Comparable<?> parseForSort(String value) { if (value == null) { return null; } Datable datable = deserializeDatable(value); return datable.isValid() ? datable.getFromYear() : null; } }
DatableFromYearPropertyParser implements PropertyParser { @Override public Comparable<?> parseForSort(String value) { if (value == null) { return null; } Datable datable = deserializeDatable(value); return datable.isValid() ? datable.getFromYear() : null; }  }
DatableFromYearPropertyParser implements PropertyParser { @Override public Comparable<?> parseForSort(String value) { if (value == null) { return null; } Datable datable = deserializeDatable(value); return datable.isValid() ? datable.getFromYear() : null; }  @Override String parse(String value); @Override Comparable<?> parseForSort(String value); }
DatableFromYearPropertyParser implements PropertyParser { @Override public Comparable<?> parseForSort(String value) { if (value == null) { return null; } Datable datable = deserializeDatable(value); return datable.isValid() ? datable.getFromYear() : null; }  @Override String parse(String value); @Override Comparable<?> parseForSort(String value);  }