@Test public void testReplaceSortOrder() throws Exception { PaginationComparator<Object> objectComparator = new TestObjectComparator(); PaginationComparator<Object> objectComparatorHandle = objectComparator.replaceSortorder("-newSort,otherSort"); Assert.assertEquals("SortOrder was not updated.", "-newSort,otherSort", objectComparator.getSortOrder()); Assert.assertEquals("The returned object should have the same hash.", objectComparator.hashCode(), objectComparatorHandle.hashCode()); objectComparator.replaceSortorder(null); Assert.assertEquals("SortOrder was not reset.", "", objectComparator.getSortOrder()); }
public PaginationComparator<T> replaceSortorder(String sortOrder) { this.sortOrder = sortOrder == null ? "" : sortOrder; return this; }
PaginationComparator implements Comparator<T> { public PaginationComparator<T> replaceSortorder(String sortOrder) { this.sortOrder = sortOrder == null ? "" : sortOrder; return this; } }
PaginationComparator implements Comparator<T> { public PaginationComparator<T> replaceSortorder(String sortOrder) { this.sortOrder = sortOrder == null ? "" : sortOrder; return this; } PaginationComparator(); protected  PaginationComparator(String defaultSortOrder); }
PaginationComparator implements Comparator<T> { public PaginationComparator<T> replaceSortorder(String sortOrder) { this.sortOrder = sortOrder == null ? "" : sortOrder; return this; } PaginationComparator(); protected  PaginationComparator(String defaultSortOrder); PaginationComparator<T> replaceSortorder(String sortOrder); }
PaginationComparator implements Comparator<T> { public PaginationComparator<T> replaceSortorder(String sortOrder) { this.sortOrder = sortOrder == null ? "" : sortOrder; return this; } PaginationComparator(); protected  PaginationComparator(String defaultSortOrder); PaginationComparator<T> replaceSortorder(String sortOrder);  }