160
160
import java .util .function .Predicate ;
161
161
import java .util .function .Supplier ;
162
162
import java .util .stream .Collectors ;
163
+ import java .util .stream .DoubleStream ;
164
+ import java .util .stream .IntStream ;
165
+ import java .util .stream .LongStream ;
163
166
import java .util .stream .Stream ;
164
167
165
168
import static java .util .Collections .emptyMap ;
@@ -804,6 +807,14 @@ public static int randomInt() {
804
807
return random ().nextInt ();
805
808
}
806
809
810
+ public static IntStream randomInts () {
811
+ return random ().ints ();
812
+ }
813
+
814
+ public static IntStream randomInts (long streamSize ) {
815
+ return random ().ints (streamSize );
816
+ }
817
+
807
818
/**
808
819
* @return a <code>long</code> between <code>0</code> and <code>Long.MAX_VALUE</code> (inclusive) chosen uniformly at random.
809
820
*/
@@ -820,6 +831,14 @@ public static double randomDouble() {
820
831
return random ().nextDouble ();
821
832
}
822
833
834
+ public static DoubleStream randomDoubles () {
835
+ return random ().doubles ();
836
+ }
837
+
838
+ public static DoubleStream randomDoubles (long streamSize ) {
839
+ return random ().doubles (streamSize );
840
+ }
841
+
823
842
/**
824
843
* Returns a double value in the interval [start, end) if lowerInclusive is
825
844
* set to true, (start, end) otherwise.
@@ -853,6 +872,14 @@ public static long randomLong() {
853
872
return random ().nextLong ();
854
873
}
855
874
875
+ public static LongStream randomLongs () {
876
+ return random ().longs ();
877
+ }
878
+
879
+ public static LongStream randomLongs (long streamSize ) {
880
+ return random ().longs (streamSize );
881
+ }
882
+
856
883
/**
857
884
* Returns a random BigInteger uniformly distributed over the range 0 to (2^64 - 1) inclusive
858
885
* Currently BigIntegers are only used for unsigned_long field type, where the max value is 2^64 - 1.
0 commit comments