@Test public void shouldCreateList(){ List<String> list = Collections.list("John", "James", "Mary", "Keith"); list.add("hello"); a(list.size()).shouldBeEqual(5); a(list.get(0)).shouldBeEqual("John"); a(list.get(1)).shouldBeEqual("James"); a(list.get(2)).shouldBeEqual("Mary"); a(list.get(3)).shouldBeEqual("Keith"); }
public static <T> List<T> list(T... values) { return new ArrayList<T>(Arrays.asList(values)); }
Collections { public static <T> List<T> list(T... values) { return new ArrayList<T>(Arrays.asList(values)); } }
Collections { public static <T> List<T> list(T... values) { return new ArrayList<T>(Arrays.asList(values)); } private  Collections(); }
Collections { public static <T> List<T> list(T... values) { return new ArrayList<T>(Arrays.asList(values)); } private  Collections(); static T[] arr(T... values); static T[] array(T... values); static Set<T> set(T... values); static Map<K, V> map(Object... keysAndValues); static List<T> li(T... values); static List<T> list(T... values); }
Collections { public static <T> List<T> list(T... values) { return new ArrayList<T>(Arrays.asList(values)); } private  Collections(); static T[] arr(T... values); static T[] array(T... values); static Set<T> set(T... values); static Map<K, V> map(Object... keysAndValues); static List<T> li(T... values); static List<T> list(T... values);  }