how to reverse a list java code example
Example 1: how to reverse a list in java
List<String> stringList = Arrays.asList("A", "B", "C");
Collections.reverse(stringList);
assertThat(stringList).containsExactly("C", "B", "A");
Example 2: Collections reverse on java
//import java.util.Collections;
//create and add items to list
Collectons.reverse(list);