In Java, we have Collections.emptyList() and Collections.EMPTY_LIST. Both have the same property:
Returns the empty list (immutable). This list is ser
Collections.EMPTY_LIST returns an old-style ListCollections.emptyList() uses type-inference and therefore returns
ListCollections.emptyList() was added in Java 1.5 and it is probably always preferable. This way, you don't need to unnecessarily cast around within your code.
Collections.emptyList() intrinsically does the cast for you.
@SuppressWarnings("unchecked")
public static final List emptyList() {
return (List) EMPTY_LIST;
}