SortAndOrderHelper { public static PropertyEditor getSortPropertyEditor() { return new ConverterBasedPropertyEditor<>(Sort::valueOf); } private  SortAndOrderHelper(); static PropertyEditor getOrderPropertyEditor(); static PropertyEditor getSortPropertyEditor(); static Comparator<DatasetDTO> getDatasetDTOComparator(Sort sortKey, Order orderKey); static Comparator<DataSetMetadata> getDataSetMetadataComparator(Sort sortKey, Order orderKey); static Comparator<PreparationDTO> getPreparationComparator(Sort sortKey, Order orderKey); static Comparator<Folder> getFolderComparator(Sort sortKey, Order orderKey);  }
@Test public void getSortPropertyEditor() { PropertyEditor sortPropertyEditor = SortAndOrderHelper.getSortPropertyEditor(); sortPropertyEditor.setAsText(NAME.camelName()); Object value = sortPropertyEditor.getValue(); assertEquals(NAME, value); }
@Test(expected = TDPException.class) public void invalidSortPropertyEditor() { PropertyEditor sortPropertyEditor = SortAndOrderHelper.getSortPropertyEditor(); sortPropertyEditor.setAsText("invalid"); }