Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.util.stream;
import org.testng.annotations.DataProvider;
import java.util.*;
import java.util.Spliterators;
import java.util.function.Supplier;
/**
* StreamTestDataProvider
*
* @author Brian Goetz
*/
/** TestNG DataProvider for ref-valued streams */
public class StreamTestDataProvider {
private static final Integer[] to0 = new Integer[0];
private static final Integer[] to1 = new Integer[1];
private static final Integer[] to10 = new Integer[10];
private static final Integer[] to100 = new Integer[100];
private static final Integer[] to1000 = new Integer[1000];
private static final Integer[] reversed = new Integer[100];
private static final Integer[] ones = new Integer[100];
private static final Integer[] twice = new Integer[200];
private static final Integer[] pseudoRandom;
private static final Object[][] testData;
private static final Object[][] withNullTestData;
private static final Object[][] spliteratorTestData;
static {
Integer[][] arrays = {to0, to1, to10, to100, to1000};
for (Integer[] arr : arrays) {
for (int i = 0; i < arr.length; i++) {
arr[i] = i;
}
}
for (int i = 0; i < reversed.length; i++) {
reversed[i] = reversed.length - i;
}
for (int i = 0; i < ones.length; i++) {
ones[i] = 1;
}
System.arraycopy(to100, 0, twice, 0, to100.length);
System.arraycopy(to100, 0, twice, to100.length, to100.length);
pseudoRandom = new Integer[LambdaTestHelpers.LONG_STRING.length()];
for (int i = 0; i < LambdaTestHelpers.LONG_STRING.length(); i++) {
pseudoRandom[i] = (int) LambdaTestHelpers.LONG_STRING.charAt(i);
}
}
static final Object[][] arrays = {
{"empty", to0},
{"0..1", to1},
{"0..10", to10},
{"0..100", to100},
{"0..1000", to1000},
{"100x[1]", ones},
{"2x[0..100]", twice},
{"reverse 0..100", reversed},
{"pseudorandom", pseudoRandom}
};
static {
{
List