The main difference is that Collections.emptyList() returns an immutable list, i.e., a list to which you cannot add elements. (Same applies to the List.of() introduced in Java 9.)

In the rare cases where you do want to modify the returned list, Collections.emptyList() and List.of() are thus not a good choices.

I'd say that returning an immutable list is perfectly fine (and even the preferred way) as long as the contract (documentation) does not explicitly state differently.


In addition, emptyList() might not create a new object with each call.

Implementations of this method need not create a separate List object for each call. Using this method is likely to have comparable cost to using the like-named field. (Unlike this method, the field does not provide type safety.)

The implementation of emptyList looks as follows:

public static final <T> List<T> emptyList() {
    return (List<T>) EMPTY_LIST;
}

So if your method (which returns an empty list) is called very often, this approach may even give you slightly better performance both CPU and memory wise.

Answer from aioobe on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › java collections › collections.emptylist() vs. new list instance
Collections.emptyList() vs. New List Instance | Baeldung
April 4, 2025 - Collections.emptyList() returns a list (java.util.Collections.EmptyList) that can’t be modified.
🌐
TutorialsPoint
tutorialspoint.com › java › util › collections_emptylist.htm
Java Collections emptyList() Method
The Java Collections emptyList() method is used to get the empty list. List is immutable and cannot be modified.
🌐
Medium
medium.com › @rahul.tpointtech12 › java-create-empty-lists-a-step-by-step-guide-5c34f03228b3
Java Create Empty Lists: A Step-by-Step Guide | by Rahul | Medium
March 22, 2025 - Resources like Tpoint Tech provide valuable insights into Java’s list manipulation techniques, empowering developers to handle collections with ease and efficiency. In Java programming, when you need to create an empty list, ArrayList comes to the rescue.
Top answer
1 of 5
119

If you are using java 9 or later:

} else {
    return List.of();
}

If you are stuck with some version of java before 9:

} else { 
    return Collections.emptyList();
}

Notes:

  1. These constructs are the most efficient, because they reuse an existing instance of an empty list, so each time you ask for an empty list, no new list gets created. However, object allocation in Java is very inexpensive, so this should not really be a concern.
  2. The list returned by either List.of() or Collections.emptyList() is secretly immutable. By secretly I mean that it exposes mutation methods, but if you make the mistake of invoking any of those methods, you will be slapped with a runtime exception. In other, better languages than Java, (for example, in Scala,) there exist immutable / unmodifiable collections, but Java does not have such a thing out of the box. So, if you are sticking with Java in 2020, you are accepting the possibility that not all of your collections can be written to, despite the fact that they all look as if they can be written to.
  3. In general, functions are meant to return immutable entities, so if you are invoking a function which returns a collection and then you intend to modify that collection, you are doing it wrong. If you really need a collection that you can modify, you should instead write your function so that it populates a mutable list that you pass to it as a parameter, so it is evident that you, as the owner of the mutable list, are free to further modify the list after the function returns.
2 of 5
12

Collections.emptyList() returns an immutable list, i.e., a list to which you cannot add elements if you want to perform any operation on your list, then create new instance of list and return it.

if (isValidLang(lang)) {
        query.setParameter("lang", lang);
        return query.getResultList();
    } else {
        return new ArrayList<Lookup>();  // return array list instance.
    }
Find elsewhere
🌐
JavaBeat
javabeat.net › collections-emptylist-method-in-java
Collections emptyList() Method in Java
December 31, 2023 - emptyList() is a built-in static method of the Java Collections class. This method doesn’t accept any parameter. It creates an empty and immutable List. It is a type-safe way of creating a list without explicitly creating a new instance of an empty List.
🌐
ZetCode
zetcode.com › java › collections-emptylist
Java Collections.emptyList - Complete Tutorial with Examples
The method returns an empty list when no results match the query. This is better than returning null as it prevents NullPointerException. Clients can safely call methods on the returned list without null checks. The code is cleaner and less error-prone. This pattern is widely used in Java libraries ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › list-isempty-method-in-java-with-examples
List isEmpty() method in Java with Examples - GeeksforGeeks
December 3, 2024 - The isEmpty() method of the List interface in Java is used to check if a list is empty or not.
🌐
Level Up Lunch
leveluplunch.com › java › examples › return-empty-list-instead-of-null
Return empty list | Level Up Lunch
January 6, 2014 - @Test public void return_empty_list_java () { List<String> emptyList = Collections.emptyList(); assertTrue(emptyList.isEmpty()); }
🌐
Codemia
codemia.io › home › knowledge hub › collections.emptylist() returns a list?
Codemia | Master System Design Interviews Through Active Practice
January 27, 2025 - If you are working within a method that requires a return type of List<T>, and under certain conditions should not return any elements, using emptyList() is a much cleaner alternative to returning null or creating a new list object.
🌐
How to do in Java
howtodoinjava.com › home › collections framework › java arraylist › check if arraylist is empty in java: isempty() vs size()
Check if ArrayList Is Empty in Java: isEmpty() vs size()
October 10, 2026 - List<String> basket = new ArrayList<>(); boolean empty = basket.isEmpty(); // true basket.add("milk"); boolean stillEmpty = basket.isEmpty(); // false boolean noItems = basket.size() == 0; // false boolean nullOrEmpty = basket == null || basket.isEmpty(); // false basket.clear(); boolean emptyAgain = basket.isEmpty(); // true · Notice the basket == null check on the sixth line, because isEmpty() cannot run on a null reference. We look at isEmpty() and size() first, cover null-safe checks with plain Java, Apache Commons and Spring, and finish with the right way to clear a list.
🌐
Codemia
codemia.io › home › knowledge hub › collections.emptylist() vs. new instance
Codemia | Master System Design Interviews Through Active Practice
January 27, 2025 - That method clearly intends to build up a list over time, so a new instance is the correct tool. A common API question sits behind this comparison: should a method return null when there is no data? In most Java APIs, the better answer is no. ... Returning an empty list lets callers iterate safely without extra null checks.