This is a smart idiom for creating and initializing a collection.
What actually happens is that you instantiate an anonymous subclass of ArrayList , which has an instance initializer block that calls add on the list instance to populate it. The internal {...} is the instance initializer block.
A similar trick can be used to create pre-initialized maps.
source share