1 package test.preserveorder; 2 3 import org.testng.annotations.Factory; 4 5 public class TestClassFactory { 6 7 @Factory f()8 public Object[] f() { 9 final Object[] res = new Object[4]; 10 for (int i = 1; i < 5; i++) { 11 res[i-1] = new TestClass(i); 12 } 13 return res; 14 } 15 } 16