CollectionsUtil.java :  » Testing » StoryTestIQ » fitnesse » util » Java Open Source

Java Open Source » Testing » StoryTestIQ 
StoryTestIQ » fitnesse » util » CollectionsUtil.java
package fitnesse.util;

import java.util.*;

public class CollectionsUtil {

  private CollectionsUtil() {
    throw new UnsupportedOperationException();
  }

  public static List createList(Object[] args) {
    List list = new ArrayList();
    for (int i = 0, len = args.length; i < len; ++i) {
      list.add(args[i]);
    }
    return list;
  }

  public static Map createMap(Object[] args) {
    Map map = new HashMap();
    for (int i = 0, len = args.length; i < len; i += 2) {
      map.put(args[i], args[i+1]);
    }
    return map;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.