//: com/mindviewinc/util/New.java // ©2015 MindView LLC: see Copyright.txt // Utilities to simplify generic container creation // by using type argument inference. package com.mindviewinc.util; import java.util.*; public class New { public static Map map() { return new HashMap<>(); } public static List list() { return new ArrayList<>(); } public static LinkedList lList() { return new LinkedList<>(); } public static Set set() { return new HashSet<>(); } public static Queue queue() { return new LinkedList<>(); } // Examples: public static void main(String[] args) { Map> sls = New.map(); List ls = New.list(); LinkedList lls = New.lList(); Set ss = New.set(); Queue qs = New.queue(); } } /* Output: (None) *///:~