content: /**
   * Copyright 2010 The Apache Software Foundation
   *
   * Licensed to the Apache Software Foundation (ASF) under one
   * or more contributor license agreements.  See the NOTICE file
   * distributed with this work for additional information
   * regarding copyright ownership.  The ASF licenses this file
   * to you under the Apache License, Version 2.0 (the
   * "License"); you may not use this file except in compliance
   * with the License.  You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package com.alibaba.wasp.util;
  
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.HashMap;
  import java.util.HashSet;
  import java.util.TreeMap;
  
  /**
   * This class contains static methods to construct commonly used generic objects
   * such as ArrayList.
   */
  public class New {
  
      /**
       * Create a new ArrayList.
       *
       * @param <T> the type
       * @return the object
       */
      public static <T> ArrayList<T> arrayList() {
          return new ArrayList<T>();
      }
  
      /**
       * Create a new HashMap.
       *
       * @param <K> the key type
       * @param <V> the value type
       * @return the object
       */
      public static <K, V> HashMap<K, V> hashMap() {
          return new HashMap<K, V>();
      }
  
        /**
       * Create a new NavigableMap.
       *
       * @param <K> the key type
       * @param <V> the value type
       * @return the object
       */
      public static <K, V> TreeMap<K, V> treeMap() {
          return new TreeMap<K, V>();
      }
  
      /**
       * Create a new HashMap.
       *
       * @param <K> the key type
       * @param <V> the value type
       * @param initialCapacity the initial capacity
       * @return the object
       */
      public static <K, V> HashMap<K, V> hashMap(int initialCapacity) {
          return new HashMap<K, V>(initialCapacity);
      }
  
      /**
       * Create a new HashSet.
       *
       * @param <T> the type
       * @return the object
       */
      public static <T> HashSet<T> hashSet() {
          return new HashSet<T>();
      }
  
      /**
       * Create a new ArrayList.
       *
       * @param <T> the type
       * @param c the collection
       * @return the object
       */
      public static <T> ArrayList<T> arrayList(Collection<T> c) {
          return new ArrayList<T>(c);
      }
  
      /**
       * Create a new ArrayList.
       *
       * @param <T> the type
       * @param initialCapacity the initial capacity
       * @return the object
       */
      public static <T> ArrayList<T> arrayList(int initialCapacity) {
          return new ArrayList<T>(initialCapacity);
      }
  }