package net.sourceforge.tuned; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; import java.util.List; public class TestUtil { public static List asParameters(Object... parameterSet) { List list = new ArrayList(); for (Object parameter : parameterSet) { list.add(new Object[] { parameter }); } return list; } public static List asList(Iterator iterator) { List list = new ArrayList(); while (iterator.hasNext()) { list.add(iterator.next()); } return list; } public static List> rotations(Collection source) { List> rotations = new ArrayList>(); for (int i = 0; i < source.size(); i++) { List copy = new ArrayList(source); Collections.rotate(copy, i); rotations.add(copy); } return rotations; } }