Java Guava | Lists.reverse() method with Examples Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Guava's Lists.reverse() method accepts a list as a parameter and returns a reversed view of the list passed as the parameter. If the specified list is random access, then the returned list is also random-access. For example: Lists.reverse(Arrays.asList(1, 2, 3)) returns a list containing 3, 2, 1. Syntax: public static <T> List<T> reverse(List<T> list) Parameter: The method accepts list as a parameter and returns a list which is backed by this list. It means that the changes made in the returned list are reflected back in the list passed as parameter to the method and vice-versa. Return Value: The method Lists.reverse() returns the reversed view of the list passed as parameter. The returned list supports all of the optional list operations supported by the list passed as parameter. Below examples illustrate the implementation of above method: Example 1: Java // Java code to show implementation of // Guava's Lists.reverse() method import com.google.common.collect.Lists; import java.util.Arrays; import java.util.List; class GFG { // Driver's code public static void main(String[] args) { // Creating a List of Integers List<Integer> myList = Arrays.asList(1, 2, 3, 4, 5); // Using Lists.reverse() method to get a // reversed view of the specified list. Any // changes in the returned list are reflected // in the original list and vice-versa List<Integer> reverse = Lists.reverse(myList); // Displaying the reversed view of specified List System.out.println(reverse); } } Output: [5, 4, 3, 2, 1] Example 2: Java // Java code to show implementation of // Guava's Lists.reverse() method import com.google.common.collect.Lists; import java.util.Arrays; import java.util.List; class GFG { // Driver's code public static void main(String[] args) { // Creating a List of Characters List<Character> myList = Arrays.asList('H', 'E', 'L', 'L', 'O'); // Using Lists.reverse() method to get a // reversed view of the specified list. Any // changes in the returned list are reflected // in the original list and vice-versa List<Character> reverse = Lists.reverse(myList); // Displaying the reversed view of specified List System.out.println(reverse); } } Output: [O, L, L, E, H] Reference: https://guava.dev/releases/23.0/api/docs/com/google/common/collect/Lists.html#reverse-java.util.List- Create Quiz Comment S Sahil_Bansall Follow 0 Improve S Sahil_Bansall Follow 0 Improve Article Tags : Java java-guava Guava-Functions Guava-Lists Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings7 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java5 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages2 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java4 min readJava Comparator Interface5 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java7 min readFile Handling in Java4 min readJava Method References7 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management3 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers1 min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like