Please explain the use of the interface Supplier(in Guava) with a suitable example .
The main reason we included Supplier in Guava was to support the Multimaps methods that generate arbitrary Multimaps, such as
public static Multimap newMultimap(Map> map,
Supplier extends Collection> factory)
The Supplier creates a Collection that holds all of the values for a given key. The Multimap uses the Supplier whenever you store a key-value pair with a key that's not already in the Multimap.