One of the Java 9 features I've tested is the List.of()
to create an unmodifiable list. I wonder - What is the purpose of this method if it returns an empty list of elements that can't be add / removed / edited?
The only thing that i was able to think of is to compare this list to another empty list, but then why not just to use someList.isEmpty()
?