//: net/mindview/util/CollectionData.java // A Collection filled with data using a generator object. package net.mindview.util; import java.util.*; public class CollectionData extends ArrayList { public CollectionData(Generator gen, int quantity) { for(int i = 0; i < quantity; i++) add(gen.next()); } // A generic convenience method: public static CollectionData list(Generator gen, int quantity) { return new CollectionData<>(gen, quantity); } } ///:~