Java 9 – Factory methods for collections

In Java 9, factory methods are introduced for collections API. Below are examples. Example:

Output: