@Test public void コールバックgenテスト() { final List<String> elements = new ArrayList<String>(); elements.add("a"); elements.add("b"); elements.add("c"); elements.add("d"); elements.add("e"); List<String> results = Lists.gen(5, new GenCall<String>() { public String gen(int index, int total) { return elements.get(index); } }); Assert.assertEquals(elements, results); }
public static <T> List<T> gen(T... elements) { if (elements == null || elements.length == 0) return Collections.<T>emptyList(); List<T> list = (List<T>) Reflects.make(LIST_IMPL); for (T t : elements) { list.add(t); } return list; }
Lists { public static <T> List<T> gen(T... elements) { if (elements == null || elements.length == 0) return Collections.<T>emptyList(); List<T> list = (List<T>) Reflects.make(LIST_IMPL); for (T t : elements) { list.add(t); } return list; } }
Lists { public static <T> List<T> gen(T... elements) { if (elements == null || elements.length == 0) return Collections.<T>emptyList(); List<T> list = (List<T>) Reflects.make(LIST_IMPL); for (T t : elements) { list.add(t); } return list; } private  Lists(); }
Lists { public static <T> List<T> gen(T... elements) { if (elements == null || elements.length == 0) return Collections.<T>emptyList(); List<T> list = (List<T>) Reflects.make(LIST_IMPL); for (T t : elements) { list.add(t); } return list; } private  Lists(); static List<T> gen(T... elements); static List<T> gen(int size, GenCall<T> generator); static U gen(int size, Class<U> container, GenCall<T> generator); static List<T> each(List<T> elements, EachCall<T> callback); static List<T> collect(List<T> elements, CollectCall<T> callback); static Map<String, List<T>> group(List<T> elements, GroupCall<T> callback); static boolean isEmpty(List<T> suspect); static PartialList<T> emptyPartialList(); }
Lists { public static <T> List<T> gen(T... elements) { if (elements == null || elements.length == 0) return Collections.<T>emptyList(); List<T> list = (List<T>) Reflects.make(LIST_IMPL); for (T t : elements) { list.add(t); } return list; } private  Lists(); static List<T> gen(T... elements); static List<T> gen(int size, GenCall<T> generator); static U gen(int size, Class<U> container, GenCall<T> generator); static List<T> each(List<T> elements, EachCall<T> callback); static List<T> collect(List<T> elements, CollectCall<T> callback); static Map<String, List<T>> group(List<T> elements, GroupCall<T> callback); static boolean isEmpty(List<T> suspect); static PartialList<T> emptyPartialList(); @SuppressWarnings("rawtypes")
    static final PartialList EMPTY_PARTIAL_LIST; }