Java 6 – Navigable collections

Example:

Output:

 

Java 7 – Invoke package, method handles, method types

Example:

Output:

 

Java 9 – Factory methods for collections

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

Output: