@Test void testToSort() { String attributeName = "attr"; String direction = Sort.Direction.DESC.name(); EditorSort editorSort = EditorSort.create(of(EditorOrder.create(attributeName, direction))); Sort sort = sortMapper.toSort(editorSort); Iterator<Sort.Order> iterator = sort.iterator(); assertTrue(iterator.hasNext()); Sort.Order order = iterator.next(); assertEquals(attributeName, order.getAttr()); assertEquals(DESC, order.getDirection()); assertFalse(iterator.hasNext()); }
Sort toSort(EditorSort editorSort) { if (editorSort == null) { return null; } List<Sort.Order> orders = editorSort.getOrders().stream().map(this::toOrder).collect(toList()); return new Sort(orders); }
SortMapper { Sort toSort(EditorSort editorSort) { if (editorSort == null) { return null; } List<Sort.Order> orders = editorSort.getOrders().stream().map(this::toOrder).collect(toList()); return new Sort(orders); } }
SortMapper { Sort toSort(EditorSort editorSort) { if (editorSort == null) { return null; } List<Sort.Order> orders = editorSort.getOrders().stream().map(this::toOrder).collect(toList()); return new Sort(orders); }  }
SortMapper { Sort toSort(EditorSort editorSort) { if (editorSort == null) { return null; } List<Sort.Order> orders = editorSort.getOrders().stream().map(this::toOrder).collect(toList()); return new Sort(orders); }   }
SortMapper { Sort toSort(EditorSort editorSort) { if (editorSort == null) { return null; } List<Sort.Order> orders = editorSort.getOrders().stream().map(this::toOrder).collect(toList()); return new Sort(orders); }    }