changeset 7362:4d1928438109

Clean up data providers.
author psandoz
date Wed, 20 Feb 2013 14:25:21 +0100
parents 32b02cd378c7
children acfcba023020
files test-ng/bootlib/java/util/stream/DoubleStreamTestDataProvider.java test-ng/bootlib/java/util/stream/IntStreamTestDataProvider.java test-ng/bootlib/java/util/stream/LongStreamTestDataProvider.java test-ng/bootlib/java/util/stream/StreamTestDataProvider.java
diffstat 4 files changed, 193 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/test-ng/bootlib/java/util/stream/DoubleStreamTestDataProvider.java	Wed Feb 20 13:36:07 2013 +0100
+++ b/test-ng/bootlib/java/util/stream/DoubleStreamTestDataProvider.java	Wed Feb 20 14:25:21 2013 +0100
@@ -86,19 +86,25 @@
                 final Object name = data[0];
                 final double[] doubles = (double[]) data[1];
 
-                list.add(new Object[]{"array:" + name, new DoubleStreamTestData.ArrayData("array:" + name, doubles)});
+                list.add(new Object[]{"array:" + name, 
+                        new DoubleStreamTestData.ArrayData("array:" + name, doubles)});
 
                 SpinedBuffer.OfDouble isl = new SpinedBuffer.OfDouble();
                 for (double i : doubles) {
                     isl.accept(i);
                 }
-                list.add(new Object[]{"SpinedList:" + name, new DoubleStreamTestData.IterableData<>("SpinedList:" + name, isl, () -> (int) isl.count())});
+                list.add(new Object[]{"SpinedList:" + name, 
+                        new DoubleStreamTestData.IterableData<>("SpinedList:" + name, isl, () -> (int) isl.count())});
 
                 // @@@ Change to doubleRange when implemented
-                list.add(new Object[]{"Primitives.range(0,l): " + doubles.length, new DoubleStreamTestData.DoubleStreamSupplierData("Primitives.range(0,l): " + doubles.length, () -> Streams.longRange(0, doubles.length).doubles())});
-                list.add(new Object[]{"Primitives.range(0,l,2): " + doubles.length, new DoubleStreamTestData.DoubleStreamSupplierData("Primitives.range(0,l,2): " + doubles.length, () -> Streams.longRange(0, doubles.length, 2).doubles())});
-                list.add(new Object[]{"Primitives.range(0,l,3): " + doubles.length, new DoubleStreamTestData.DoubleStreamSupplierData("Primitives.range(0,l,3): " + doubles.length, () -> Streams.longRange(0, doubles.length, 3).doubles())});
-                list.add(new Object[]{"Primitives.range(0,l,7): " + doubles.length, new DoubleStreamTestData.DoubleStreamSupplierData("Primitives.range(0,l,7): " + doubles.length, () -> Streams.longRange(0, doubles.length, 7).doubles())});
+                list.add(streamDataDescr("Primitives.range(0,l): " + doubles.length,
+                                         () -> Streams.longRange(0, doubles.length).doubles()));
+                list.add(streamDataDescr("Primitives.range(0,l,2): " + doubles.length,
+                                         () -> Streams.longRange(0, doubles.length, 2).doubles()));
+                list.add(streamDataDescr("Primitives.range(0,l,3): " + doubles.length,
+                                         () -> Streams.longRange(0, doubles.length, 3).doubles()));
+                list.add(streamDataDescr("Primitives.range(0,l,7): " + doubles.length,
+                                         () -> Streams.longRange(0, doubles.length, 7).doubles()));
             }
             testData = list.toArray(new Object[0][]);
         }
@@ -114,16 +120,28 @@
                     isl.accept(i);
                 }
 
-                spliterators.add(new Object[]{"Arrays.s(array):" + name, (Supplier<Spliterator.OfDouble>) () -> Arrays.spliterator(doubles)});
-                spliterators.add(new Object[]{"Arrays.s(array,o,l):" + name, (Supplier<Spliterator.OfDouble>) () -> Arrays.spliterator(doubles, 0, doubles.length / 2)});
-                spliterators.add(new Object[]{"SpinedBuffer.s():" + name, (Supplier<Spliterator.OfDouble>) () -> isl.spliterator()});
-                spliterators.add(new Object[]{"Primitives.s(SpinedBuffer.iterator(), size):" + name, (Supplier<Spliterator.OfDouble>) () -> Streams.doubleSpliterator(isl.iterator(), doubles.length, 0)});
-                spliterators.add(new Object[]{"Primitives.s(SpinedBuffer.iterator()):" + name, (Supplier<Spliterator.OfDouble>) () -> Streams.doubleSpliteratorUnknownSize(isl.iterator(), 0)});
+                spliterators.add(splitDescr("Arrays.s(array):" + name,
+                                            () -> Arrays.spliterator(doubles)));
+                spliterators.add(splitDescr("Arrays.s(array,o,l):" + name,
+                                            () -> Arrays.spliterator(doubles, 0, doubles.length / 2)));
+
+                spliterators.add(splitDescr("SpinedBuffer.s():" + name,
+                                            () -> isl.spliterator()));
+
+                spliterators.add(splitDescr("Primitives.s(SpinedBuffer.iterator(), size):" + name,
+                                            () -> Streams.doubleSpliterator(isl.iterator(), doubles.length, 0)));
+                spliterators.add(splitDescr("Primitives.s(SpinedBuffer.iterator()):" + name,
+                                            () -> Streams.doubleSpliteratorUnknownSize(isl.iterator(), 0)));
+
                 // @@@ Change to doubleRange when implemented
-                spliterators.add(new Object[]{"Primitives.range(0,l):" + name, (Supplier<Spliterator.OfDouble>) () -> Streams.longRange(0, doubles.length).doubles().spliterator()});
-                spliterators.add(new Object[]{"Primitives.range(0,l,2):" + name, (Supplier<Spliterator.OfDouble>) () -> Streams.longRange(0, doubles.length, 2).doubles().spliterator()});
-                spliterators.add(new Object[]{"Primitives.range(0,l,3):" + name, (Supplier<Spliterator.OfDouble>) () -> Streams.longRange(0, doubles.length, 3).doubles().spliterator()});
-                spliterators.add(new Object[]{"Primitives.range(0,l,7):" + name, (Supplier<Spliterator.OfDouble>) () -> Streams.longRange(0, doubles.length, 7).doubles().spliterator()});
+                spliterators.add(splitDescr("Primitives.range(0,l):" + name,
+                                            () -> Streams.longRange(0, doubles.length).doubles().spliterator()));
+                spliterators.add(splitDescr("Primitives.range(0,l,2):" + name,
+                                            () -> Streams.longRange(0, doubles.length, 2).doubles().spliterator()));
+                spliterators.add(splitDescr("Primitives.range(0,l,3):" + name,
+                                            () -> Streams.longRange(0, doubles.length, 3).doubles().spliterator()));
+                spliterators.add(splitDescr("Primitives.range(0,l,7):" + name,
+                                            () -> Streams.longRange(0, doubles.length, 7).doubles().spliterator()));
                 // Need more!
             }
             spliteratorTestData = spliterators.toArray(new Object[0][]);
@@ -131,6 +149,14 @@
 
     }
 
+    static <T> Object[] streamDataDescr(String description, Supplier<DoubleStream> s) {
+        return new Object[] { description, new DoubleStreamTestData.DoubleStreamSupplierData(description, s) };
+    }
+
+    static <T> Object[] splitDescr(String description, Supplier<Spliterator.OfDouble> s) {
+        return new Object[] { description, s };
+    }
+
     // Return an array of ( String name, DoubleStreamTestData )
     @DataProvider(name = "DoubleStreamTestData")
     public static Object[][] makeDoubleStreamTestData() {
--- a/test-ng/bootlib/java/util/stream/IntStreamTestDataProvider.java	Wed Feb 20 13:36:07 2013 +0100
+++ b/test-ng/bootlib/java/util/stream/IntStreamTestDataProvider.java	Wed Feb 20 14:25:21 2013 +0100
@@ -86,23 +86,33 @@
                 final Object name = data[0];
                 final int[] ints = (int[]) data[1];
 
-                list.add(new Object[]{"array:" + name, new IntStreamTestData.ArrayData("array:" + name, ints)});
+                list.add(new Object[]{"array:" +
+                                      name, new IntStreamTestData.ArrayData("array:" + name, ints)});
 
                 SpinedBuffer.OfInt isl = new SpinedBuffer.OfInt();
                 for (int i : ints) {
                     isl.accept(i);
                 }
-                list.add(new Object[]{"SpinedList:" + name, new IntStreamTestData.IterableData<>("SpinedList:" + name, isl, () -> (int) isl.count())});
+                list.add(new Object[]{"SpinedList:" + name,
+                        new IntStreamTestData.IterableData<>("SpinedList:" + name, isl, () -> (int) isl.count())});
 
-                list.add(new Object[]{"Streams.intRange(0,l): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(0,l): " + ints.length, () -> Streams.intRange(0, ints.length))});
-                list.add(new Object[]{"Streams.intRange(0,l,2): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(0,l,2): " + ints.length, () -> Streams.intRange(0, ints.length, 2))});
-                list.add(new Object[]{"Streams.intRange(0,l,3): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(0,l,3): " + ints.length, () -> Streams.intRange(0, ints.length, 3))});
-                list.add(new Object[]{"Streams.intRange(0,l,7): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(0,l,7): " + ints.length, () -> Streams.intRange(0, ints.length, 7))});
+                list.add(streamDataDescr("Streams.intRange(0,l): " + ints.length,
+                                         () -> Streams.intRange(0, ints.length)));
+                list.add(streamDataDescr("Streams.intRange(0,l,2): " + ints.length,
+                                         () -> Streams.intRange(0, ints.length, 2)));
+                list.add(streamDataDescr("Streams.intRange(0,l,3): " + ints.length,
+                                         () -> Streams.intRange(0, ints.length, 3)));
+                list.add(streamDataDescr("Streams.intRange(0,l,7): " + ints.length,
+                                         () -> Streams.intRange(0, ints.length, 7)));
 
-                list.add(new Object[]{"Streams.intRange(l): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(l,0): " + ints.length, () -> Streams.intRange(ints.length, 0))});
-                list.add(new Object[]{"Streams.intRange(l,0,-2): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(l,0,-2): " + ints.length, () -> Streams.intRange(ints.length, 0, -2))});
-                list.add(new Object[]{"Streams.intRange(l,0,-3): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(l,0,-3): " + ints.length, () -> Streams.intRange(ints.length, 0, -3))});
-                list.add(new Object[]{"Streams.intRange(l,0,-7): " + ints.length, new IntStreamTestData.IntStreamSupplierData("Streams.intRange(l,0,-7): " + ints.length, () -> Streams.intRange(ints.length, 0, -7))});
+                list.add(streamDataDescr("Streams.intRange(l): " + ints.length,
+                                         () -> Streams.intRange(ints.length, 0)));
+                list.add(streamDataDescr("Streams.intRange(l,0,-2): " + ints.length,
+                                         () -> Streams.intRange(ints.length, 0, -2)));
+                list.add(streamDataDescr("Streams.intRange(l,0,-3): " + ints.length,
+                                         () -> Streams.intRange(ints.length, 0, -3)));
+                list.add(streamDataDescr("Streams.intRange(l,0,-7): " + ints.length,
+                                         () -> Streams.intRange(ints.length, 0, -7)));
             }
             testData = list.toArray(new Object[0][]);
         }
@@ -118,23 +128,36 @@
                     isl.accept(i);
                 }
 
-                spliterators.add(new Object[]{"Arrays.s(array):" + name, (Supplier<Spliterator.OfInt>) () -> Arrays.spliterator(ints)});
-                spliterators.add(new Object[]{"Arrays.s(array,o,l):" + name, (Supplier<Spliterator.OfInt>) () -> Arrays.spliterator(ints, 0, ints.length / 2)});
+                spliterators.add(splitDescr("Arrays.s(array):" + name,
+                                            () -> Arrays.spliterator(ints)));
+                spliterators.add(splitDescr("Arrays.s(array,o,l):" + name,
+                                            () -> Arrays.spliterator(ints, 0, ints.length / 2)));
 
-                spliterators.add(new Object[]{"SpinedBuffer.s():" + name, (Supplier<Spliterator.OfInt>) () -> isl.spliterator()});
+                spliterators.add(splitDescr("SpinedBuffer.s():" + name,
+                                            () -> isl.spliterator()));
 
-                spliterators.add(new Object[]{"Primitives.s(SpinedBuffer.iterator(), size):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intSpliterator(isl.iterator(), ints.length, 0)});
-                spliterators.add(new Object[]{"Primitives.s(SpinedBuffer.iterator()):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intSpliteratorUnknownSize(isl.iterator(), 0)});
+                spliterators.add(splitDescr("Primitives.s(SpinedBuffer.iterator(), size):" + name,
+                                            () -> Streams.intSpliterator(isl.iterator(), ints.length, 0)));
+                spliterators.add(splitDescr("Primitives.s(SpinedBuffer.iterator()):" + name,
+                                            () -> Streams.intSpliteratorUnknownSize(isl.iterator(), 0)));
 
-                spliterators.add(new Object[]{"Streams.intRange(0,l):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(0, ints.length).spliterator()});
-                spliterators.add(new Object[]{"Streams.intRange(0,l,2):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(0, ints.length, 2).spliterator()});
-                spliterators.add(new Object[]{"Streams.intRange(0,l,3):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(0, ints.length, 3).spliterator()});
-                spliterators.add(new Object[]{"Streams.intRange(0,l,7):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(0, ints.length, 7).spliterator()});
+                spliterators.add(splitDescr("Streams.intRange(0,l):" + name,
+                                            () -> Streams.intRange(0, ints.length).spliterator()));
+                spliterators.add(splitDescr("Streams.intRange(0,l,2):" + name,
+                                            () -> Streams.intRange(0, ints.length, 2).spliterator()));
+                spliterators.add(splitDescr("Streams.intRange(0,l,3):" + name,
+                                            () -> Streams.intRange(0, ints.length, 3).spliterator()));
+                spliterators.add(splitDescr("Streams.intRange(0,l,7):" + name,
+                                            () -> Streams.intRange(0, ints.length, 7).spliterator()));
 
-                spliterators.add(new Object[]{"Streams.intRange(l,0):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(ints.length, 0).spliterator()});
-                spliterators.add(new Object[]{"Streams.intRange(l,0,-2):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(ints.length, 0, -2).spliterator()});
-                spliterators.add(new Object[]{"Streams.intRange(l,0,-3):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(ints.length, 0, -3).spliterator()});
-                spliterators.add(new Object[]{"Streams.intRange(l,0,-7):" + name, (Supplier<Spliterator.OfInt>) () -> Streams.intRange(ints.length, 0, -7).spliterator()});
+                spliterators.add(splitDescr("Streams.intRange(l,0):" + name,
+                                            () -> Streams.intRange(ints.length, 0).spliterator()));
+                spliterators.add(splitDescr("Streams.intRange(l,0,-2):" + name,
+                                            () -> Streams.intRange(ints.length, 0, -2).spliterator()));
+                spliterators.add(splitDescr("Streams.intRange(l,0,-3):" + name,
+                                            () -> Streams.intRange(ints.length, 0, -3).spliterator()));
+                spliterators.add(splitDescr("Streams.intRange(l,0,-7):" + name,
+                                            () -> Streams.intRange(ints.length, 0, -7).spliterator()));
                 // Need more!
             }
             spliteratorTestData = spliterators.toArray(new Object[0][]);
@@ -142,6 +165,14 @@
 
     }
 
+    static <T> Object[] streamDataDescr(String description, Supplier<IntStream> s) {
+        return new Object[] { description, new IntStreamTestData.IntStreamSupplierData(description, s) };
+    }
+
+    static <T> Object[] splitDescr(String description, Supplier<Spliterator.OfInt> s) {
+        return new Object[] { description, s };
+    }
+
     // Return an array of ( String name, IntStreamTestData )
     @DataProvider(name = "IntStreamTestData")
     public static Object[][] makeIntStreamTestData() {
--- a/test-ng/bootlib/java/util/stream/LongStreamTestDataProvider.java	Wed Feb 20 13:36:07 2013 +0100
+++ b/test-ng/bootlib/java/util/stream/LongStreamTestDataProvider.java	Wed Feb 20 14:25:21 2013 +0100
@@ -86,23 +86,33 @@
                 final Object name = data[0];
                 final long[] longs = (long[]) data[1];
 
-                list.add(new Object[]{"array:" + name, new LongStreamTestData.ArrayData("array:" + name, longs)});
+                list.add(new Object[]{"array:" + name, 
+                        new LongStreamTestData.ArrayData("array:" + name, longs)});
 
                 SpinedBuffer.OfLong isl = new SpinedBuffer.OfLong();
                 for (long i : longs) {
                     isl.accept(i);
                 }
-                list.add(new Object[]{"SpinedList:" + name, new LongStreamTestData.IterableData<>("SpinedList:" + name, isl, () -> (int) isl.count())});
+                list.add(new Object[]{"SpinedList:" + name, 
+                        new LongStreamTestData.IterableData<>("SpinedList:" + name, isl, () -> (int) isl.count())});
 
-                list.add(new Object[]{"Streams.longRange(0,l): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(0,l): " + longs.length, () -> Streams.longRange(0, longs.length))});
-                list.add(new Object[]{"Streams.longRange(0,l,2): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(0,l,2): " + longs.length, () -> Streams.longRange(0, longs.length, 2))});
-                list.add(new Object[]{"Streams.longRange(0,l,3): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(0,l,3): " + longs.length, () -> Streams.longRange(0, longs.length, 3))});
-                list.add(new Object[]{"Streams.longRange(0,l,7): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(0,l,7): " + longs.length, () -> Streams.longRange(0, longs.length, 7))});
+                list.add(streamDataDescr("Streams.longRange(0,l): " + longs.length,
+                                         () -> Streams.longRange(0, longs.length)));
+                list.add(streamDataDescr("Streams.longRange(0,l,2): " + longs.length,
+                                         () -> Streams.longRange(0, longs.length, 2)));
+                list.add(streamDataDescr("Streams.longRange(0,l,3): " + longs.length,
+                                         () -> Streams.longRange(0, longs.length, 3)));
+                list.add(streamDataDescr("Streams.longRange(0,l,7): " + longs.length,
+                                         () -> Streams.longRange(0, longs.length, 7)));
 
-                list.add(new Object[]{"Streams.longRange(l): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(l, 0): " + longs.length, () -> Streams.longRange(longs.length, 0))});
-                list.add(new Object[]{"Streams.longRange(l,0,-2): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(l,0,-2): " + longs.length, () -> Streams.longRange(longs.length, 0, -2))});
-                list.add(new Object[]{"Streams.longRange(l,0,-3): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(l,0,-3): " + longs.length, () -> Streams.longRange(longs.length, 0, -3))});
-                list.add(new Object[]{"Streams.longRange(l,0,-7): " + longs.length, new LongStreamTestData.LongStreamSupplierData("Streams.longRange(l,0,-7): " + longs.length, () -> Streams.longRange(longs.length, 0, -7))});
+                list.add(streamDataDescr("Streams.longRange(l): " + longs.length,
+                                         () -> Streams.longRange(longs.length, 0)));
+                list.add(streamDataDescr("Streams.longRange(l,0,-2): " + longs.length,
+                                         () -> Streams.longRange(longs.length, 0, -2)));
+                list.add(streamDataDescr("Streams.longRange(l,0,-3): " + longs.length,
+                                         () -> Streams.longRange(longs.length, 0, -3)));
+                list.add(streamDataDescr("Streams.longRange(l,0,-7): " + longs.length,
+                                         () -> Streams.longRange(longs.length, 0, -7)));
             }
             testData = list.toArray(new Object[0][]);
         }
@@ -118,23 +128,36 @@
                     isl.accept(i);
                 }
 
-                spliterators.add(new Object[]{"Arrays.s(array):" + name, (Supplier<Spliterator.OfLong>) () -> Arrays.spliterator(longs)});
-                spliterators.add(new Object[]{"Arrays.s(array,o,l):" + name, (Supplier<Spliterator.OfLong>) () -> Arrays.spliterator(longs, 0, longs.length / 2)});
+                spliterators.add(splitDescr("Arrays.s(array):" + name,
+                                            () -> Arrays.spliterator(longs)));
+                spliterators.add(splitDescr("Arrays.s(array,o,l):" + name,
+                                            () -> Arrays.spliterator(longs, 0, longs.length / 2)));
 
-                spliterators.add(new Object[]{"SpinedBuffer.s():" + name, (Supplier<Spliterator.OfLong>) () -> isl.spliterator()});
+                spliterators.add(splitDescr("SpinedBuffer.s():" + name,
+                                            () -> isl.spliterator()));
 
-                spliterators.add(new Object[]{"Primitives.s(SpinedBuffer.iterator(), size):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longSpliterator(isl.iterator(), longs.length, 0)});
-                spliterators.add(new Object[]{"Primitives.s(SpinedBuffer.iterator()):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longSpliteratorUnknownSize(isl.iterator(), 0)});
+                spliterators.add(splitDescr("Primitives.s(SpinedBuffer.iterator(), size):" + name,
+                                            () -> Streams.longSpliterator(isl.iterator(), longs.length, 0)));
+                spliterators.add(splitDescr("Primitives.s(SpinedBuffer.iterator()):" + name,
+                                            () -> Streams.longSpliteratorUnknownSize(isl.iterator(), 0)));
 
-                spliterators.add(new Object[]{"Streams.longRange(0,l):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(0, longs.length).spliterator()});
-                spliterators.add(new Object[]{"Streams.longRange(0,l,2):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(0, longs.length, 2).spliterator()});
-                spliterators.add(new Object[]{"Streams.longRange(0,l,3):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(0, longs.length, 3).spliterator()});
-                spliterators.add(new Object[]{"Streams.longRange(0,l,7):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(0, longs.length, 7).spliterator()});
+                spliterators.add(splitDescr("Streams.longRange(0,l):" + name,
+                                            () -> Streams.longRange(0, longs.length).spliterator()));
+                spliterators.add(splitDescr("Streams.longRange(0,l,2):" + name,
+                                            () -> Streams.longRange(0, longs.length, 2).spliterator()));
+                spliterators.add(splitDescr("Streams.longRange(0,l,3):" + name,
+                                            () -> Streams.longRange(0, longs.length, 3).spliterator()));
+                spliterators.add(splitDescr("Streams.longRange(0,l,7):" + name,
+                                            () -> Streams.longRange(0, longs.length, 7).spliterator()));
 
-                spliterators.add(new Object[]{"Streams.longRange(l,0):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(longs.length, 0).spliterator()});
-                spliterators.add(new Object[]{"Streams.longRange(l,0,-2):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(longs.length, 0, -2).spliterator()});
-                spliterators.add(new Object[]{"Streams.longRange(l,0,-3):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(longs.length, 0, -3).spliterator()});
-                spliterators.add(new Object[]{"Streams.longRange(l,0,-7):" + name, (Supplier<Spliterator.OfLong>) () -> Streams.longRange(longs.length, 0, -7).spliterator()});
+                spliterators.add(splitDescr("Streams.longRange(l,0):" + name,
+                                            () -> Streams.longRange(longs.length, 0).spliterator()));
+                spliterators.add(splitDescr("Streams.longRange(l,0,-2):" + name,
+                                            () -> Streams.longRange(longs.length, 0, -2).spliterator()));
+                spliterators.add(splitDescr("Streams.longRange(l,0,-3):" + name,
+                                            () -> Streams.longRange(longs.length, 0, -3).spliterator()));
+                spliterators.add(splitDescr("Streams.longRange(l,0,-7):" + name,
+                                            () -> Streams.longRange(longs.length, 0, -7).spliterator()));
                 // Need more!
             }
             spliteratorTestData = spliterators.toArray(new Object[0][]);
@@ -142,6 +165,14 @@
 
     }
 
+    static <T> Object[] streamDataDescr(String description, Supplier<LongStream> s) {
+        return new Object[] { description, new LongStreamTestData.LongStreamSupplierData(description, s) };
+    }
+
+    static <T> Object[] splitDescr(String description, Supplier<Spliterator.OfLong> s) {
+        return new Object[] { description, s };
+    }
+
     // Return an array of ( String name, LongStreamTestData )
     @DataProvider(name = "LongStreamTestData")
     public static Object[][] makeLongStreamTestData() {
--- a/test-ng/bootlib/java/util/stream/StreamTestDataProvider.java	Wed Feb 20 13:36:07 2013 +0100
+++ b/test-ng/bootlib/java/util/stream/StreamTestDataProvider.java	Wed Feb 20 14:25:21 2013 +0100
@@ -89,16 +89,29 @@
             for (Object[] data : arrays) {
                 final Object name = data[0];
                 final Integer[] ints = (Integer[])data[1];
+                final List<Integer> intsAsList = Arrays.asList(ints);
 
-                list.add(arrayDataDescr("array:" + name, ints, StreamTestData.ArrayData::new));
-                list.add(collectionDataDescr("ArrayList.asList:" + name, Arrays.asList(ints), StreamTestData.CollectionData::new));
-                list.add(collectionDataDescr("ArrayList:" + name, new ArrayList<>(Arrays.asList(ints)), StreamTestData.CollectionData::new));
-                List<Integer> aList = new ArrayList<>(Arrays.asList(ints));
-                list.add(collectionDataDescr("Sublist:" + name, (ints.length) <= 1 ? aList.subList(0, 0) : aList.subList(1, ints.length / 2),
-                                             StreamTestData.CollectionData::new));
-                list.add(collectionDataDescr("HashSet:" + name, new HashSet<>(Arrays.asList(ints)), StreamTestData.CollectionData::new));
-                list.add(collectionDataDescr("TreeSet:" + name, new TreeSet<>(Arrays.asList(ints)), StreamTestData.CollectionData::new));
-                list.add(sbDataDescr("SpinedBuffer:" + name, new SpinedBuffer<>(Arrays.asList(ints)), StreamTestData.SpinedBufferData::new));
+                list.add(arrayDataDescr("array:" + name,
+                                        ints));
+                list.add(collectionDataDescr("ArrayList.asList:" + name,
+                                             intsAsList));
+                list.add(collectionDataDescr("ArrayList:" + name,
+                                             new ArrayList<>(intsAsList)));
+                List<Integer> aList = new ArrayList<>(intsAsList);
+                list.add(collectionDataDescr("ArrayList.Sublist:" + name,
+                                             (ints.length) <= 1 ? aList.subList(0, 0) : aList.subList(1, ints.length / 2)));
+                list.add(collectionDataDescr("LinkedList:" + name,
+                                             new LinkedList<>(intsAsList)));
+                list.add(collectionDataDescr("HashSet:" + name,
+                                             new HashSet<>(intsAsList)));
+                list.add(collectionDataDescr("LinkedHashSet:" + name,
+                                             new LinkedHashSet<>(intsAsList)));
+                list.add(collectionDataDescr("TreeSet:" + name,
+                                             new TreeSet<>(intsAsList)));
+                list.add(sbDataDescr("SpinedBuffer:" + name,
+                                     new SpinedBuffer<>(intsAsList)));
+
+                // @@@ Add more
             }
             testData = list.toArray(new Object[0][]);
         }
@@ -116,7 +129,7 @@
                     content[e] = (i & (1 << e)) > 0 ? e + 1 : null;
                 }
 
-                list.add(arrayDataDescr("array:" + i, content, StreamTestData.ArrayData::new));
+                list.add(arrayDataDescr("array:" + i, content));
             }
 
             withNullTestData = list.toArray(new Object[0][]);
@@ -128,27 +141,36 @@
                 final Object name = data[0];
                 final Integer[] ints = (Integer[])data[1];
 
-                spliterators.add(new Object[] { "Arrays.s(array):" + name, (Supplier<Spliterator<Integer>>) () -> Arrays.spliterator(ints) });
-                spliterators.add(new Object[] { "arrays.s(array,o,l):" + name, (Supplier<Spliterator<Integer>>) () -> Arrays.spliterator(ints, 0, ints.length/2) });
-                spliterators.add(new Object[] { "SpinedBuffer.s():" + name, (Supplier<Spliterator<Integer>>) () -> new SpinedBuffer<>(Arrays.asList(ints)).spliterator() });
-                spliterators.add(new Object[] { "Iterators.s(Arrays.s(array).iterator(), size):" + name, (Supplier<Spliterator<Integer>>) () -> Streams.spliterator(Arrays.asList(ints).iterator(), ints.length, 0) });
-                spliterators.add(new Object[] { "Iterators.s(Arrays.s(array).iterator()):" + name, (Supplier<Spliterator<Integer>>) () -> Streams.spliteratorUnknownSize(Arrays.asList(ints).iterator(), 0) });
-                // Need more!
+                spliterators.add(splitDescr("Arrays.s(array):" + name,
+                                            () -> Arrays.spliterator(ints)));
+                spliterators.add(splitDescr("arrays.s(array,o,l):" + name,
+                                            () -> Arrays.spliterator(ints, 0, ints.length/2)));
+                spliterators.add(splitDescr("SpinedBuffer.s():" + name,
+                                            () -> new SpinedBuffer<>(Arrays.asList(ints)).spliterator()));
+                spliterators.add(splitDescr("Iterators.s(Arrays.s(array).iterator(), size):" + name,
+                                            () -> Streams.spliterator(Arrays.asList(ints).iterator(), ints.length, 0)));
+                spliterators.add(splitDescr("Iterators.s(Arrays.s(array).iterator()):" + name,
+                                            () -> Streams.spliteratorUnknownSize(Arrays.asList(ints).iterator(), 0)));
+                // @@@ Add map and collection spliterators when spliterator() is exposed on Collection or Iterable
             }
             spliteratorTestData = spliterators.toArray(new Object[0][]);
         }
     }
 
-    static <T> Object[] arrayDataDescr(String description, T[] data, BiFunction<String, T[], StreamTestData<T>> m) {
-        return new Object[] { description, m.apply(description, data) };
+    static <T> Object[] arrayDataDescr(String description, T[] data) {
+        return new Object[] { description, new StreamTestData.ArrayData<>(description, data) };
     }
 
-    static <T> Object[] collectionDataDescr(String description, Collection<T> data, BiFunction<String, Collection<T>, StreamTestData<T>> m) {
-        return new Object[] { description, m.apply(description, data) };
+    static <T> Object[] collectionDataDescr(String description, Collection<T> data) {
+        return new Object[] { description, new StreamTestData.CollectionData<>(description, data) };
     }
 
-    static <T> Object[] sbDataDescr(String description, SpinedBuffer<T> data, BiFunction<String, SpinedBuffer<T>, StreamTestData<T>> m) {
-        return new Object[] { description, m.apply(description, data) };
+    static <T> Object[] sbDataDescr(String description, SpinedBuffer<T> data) {
+        return new Object[] { description, new StreamTestData.SpinedBufferData<>(description, data) };
+    }
+
+    static <T> Object[] splitDescr(String description, Supplier<Spliterator<T>> ss) {
+        return new Object[] { description, ss };
     }
 
     // Return an array of ( String name, StreamTestData<Integer> )