Class CollectionFactory

  • public final class CollectionFactory
    extends Object
    Static factory methods to ease the creation of new collection types (when using generics). Most of these method leverage the compiler's ability to match generic types by return value. Typical usage (with a static import):
     Map<Foo, Bar> map = newMap();
    This is a replacement for:
     Map<Foo, Bar> map = new HashMap<Foo, Bar>();