List of utility methods to do Collection Sub Collection Get
Collection | subset(Collection c, int size, java.util.Random rand) subset ArrayList list = new ArrayList(c); int realSize = (size < c.size()) ? size : c.size(); java.util.Collections.shuffle(list, rand); return list.subList(0, realSize); |