SortAndOrderHelper { public static PropertyEditor getOrderPropertyEditor() { return new ConverterBasedPropertyEditor<>(Order::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 getOrderPropertyEditor() { PropertyEditor sortPropertyEditor = SortAndOrderHelper.getOrderPropertyEditor(); sortPropertyEditor.setAsText(DESC.camelName()); Object value = sortPropertyEditor.getValue(); assertEquals(DESC, value); }
@Test(expected = TDPException.class) public void invalidOrderPropertyEditor() { PropertyEditor sortPropertyEditor = SortAndOrderHelper.getOrderPropertyEditor(); sortPropertyEditor.setAsText("invalid"); }