01: package fitnesse.util;
02:
03: import java.util.*;
04:
05: public class CollectionsUtil {
06:
07: private CollectionsUtil() {
08: throw new UnsupportedOperationException();
09: }
10:
11: public static List createList(Object[] args) {
12: List list = new ArrayList();
13: for (int i = 0, len = args.length; i < len; ++i) {
14: list.add(args[i]);
15: }
16: return list;
17: }
18:
19: public static Map createMap(Object[] args) {
20: Map map = new HashMap();
21: for (int i = 0, len = args.length; i < len; i += 2) {
22: map.put(args[i], args[i + 1]);
23: }
24: return map;
25: }
26:
27: }
|