Source:
<code>public void testResolvingMultipleSortOrdersReturnsCompositeComparator() { KeyValueQuery<Predicate<String, Foo>> query = new KeyValueQuery<>(); Sort.Order fooOrder = new Sort.Order(Sort.Direction.DESC, "foo"); Sort.Order barOrder = new Sort.Order(Sort.Direction.DESC, "bar"); <START> List<Sort.Order> orderList = new LinkedList<>(); orderList.add(fooOrder); orderList.add(barOrder); query.setSort(Sort.by(orderList)); <END> HazelcastSortAccessorTest.Foo testData1 = new HazelcastSortAccessorTest.Foo("zzz", "def"); HazelcastSortAccessorTest.Foo testData2 = new HazelcastSortAccessorTest.Foo("aaa", "aaa"); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry1 = entryOf("testData1", testData1); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry2 = entryOf("testData2", testData2); HazelcastSortAccessorTest.Foo testData3 = new HazelcastSortAccessorTest.Foo("aaa", "aaa"); HazelcastSortAccessorTest.Foo testData4 = new HazelcastSortAccessorTest.Foo("aaa", "def"); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry3 = entryOf("testData3", testData3); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry4 = entryOf("testData4", testData4); HazelcastSortAccessor hazelcastSortAccessor = new HazelcastSortAccessor(); Comparator<Map.Entry<?, ?>> comparator = (Comparator<Map.Entry<?, ?>>) hazelcastSortAccessor.resolve((KeyValueQuery<?>) query); assertNotNull(comparator); assertTrue(comparator.compare(entry1, entry2) < 0); assertTrue(comparator.compare(entry2, entry1) > 0); assertFalse(comparator.compare(entry3, entry4) == 0); assertTrue((comparator.compare(entry3, entry4) > 0)); }</code><technical_language>suggestion query.setSort(Sort.by(fooOrder, barOrder));</technical_language>

Target:
public void testResolvingMultipleSortOrdersReturnsCompositeComparator() { KeyValueQuery<Predicate<String, Foo>> query = new KeyValueQuery<>(); Sort.Order fooOrder = new Sort.Order(Sort.Direction.DESC, "foo"); Sort.Order barOrder = new Sort.Order(Sort.Direction.DESC, "bar"); query.setSort(Sort.by(fooOrder, barOrder)); HazelcastSortAccessorTest.Foo testData1 = new HazelcastSortAccessorTest.Foo("zzz", "def"); HazelcastSortAccessorTest.Foo testData2 = new HazelcastSortAccessorTest.Foo("aaa", "aaa"); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry1 = entryOf("testData1", testData1); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry2 = entryOf("testData2", testData2); HazelcastSortAccessorTest.Foo testData3 = new HazelcastSortAccessorTest.Foo("aaa", "aaa"); HazelcastSortAccessorTest.Foo testData4 = new HazelcastSortAccessorTest.Foo("aaa", "def"); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry3 = entryOf("testData3", testData3); Map.Entry<String, HazelcastSortAccessorTest.Foo> entry4 = entryOf("testData4", testData4); HazelcastSortAccessor hazelcastSortAccessor = new HazelcastSortAccessor(); Comparator<Map.Entry<?, ?>> comparator = (Comparator<Map.Entry<?, ?>>) hazelcastSortAccessor.resolve((KeyValueQuery<?>) query); assertNotNull(comparator); assertTrue(comparator.compare(entry1, entry2) < 0); assertTrue(comparator.compare(entry2, entry1) > 0); assertFalse(comparator.compare(entry3, entry4) == 0); assertTrue((comparator.compare(entry3, entry4) > 0)); }