@Test public void testRandomLongsBoundedSpecialCases() { final Random random1 = new Random() { long index = 0; @Override public long nextLong() { index++; if (index % 15 == 0) return Long.MIN_VALUE; if (index % 10 == 0) return Long.MAX_VALUE; return super.nextLong(); } }; new RandomCompat(random1).longs(Long.MIN_VALUE + 2, Long.MAX_VALUE).peek(new LongConsumer() { @Override public void accept(long value) { if (value < (Long.MIN_VALUE + 2)) fail(); } }).limit(30).count(); final Random random2 = new Random() { long index = 0; @Override public long nextLong() { index++; if (index < 5) return Long.MIN_VALUE >> 2; return super.nextLong(); } }; new RandomCompat(random2).longs(Long.MIN_VALUE >>> 4, Long.MIN_VALUE >>> 1).limit(30).count(); }
@NotNull public LongStream longs(long streamSize) { if (streamSize < 0L) throw new IllegalArgumentException(); if (streamSize == 0L) { return LongStream.empty(); } return longs().limit(streamSize); }
RandomCompat { @NotNull public LongStream longs(long streamSize) { if (streamSize < 0L) throw new IllegalArgumentException(); if (streamSize == 0L) { return LongStream.empty(); } return longs().limit(streamSize); } }
RandomCompat { @NotNull public LongStream longs(long streamSize) { if (streamSize < 0L) throw new IllegalArgumentException(); if (streamSize == 0L) { return LongStream.empty(); } return longs().limit(streamSize); } RandomCompat();  RandomCompat(long seed);  RandomCompat(@NotNull Random random); }
RandomCompat { @NotNull public LongStream longs(long streamSize) { if (streamSize < 0L) throw new IllegalArgumentException(); if (streamSize == 0L) { return LongStream.empty(); } return longs().limit(streamSize); } RandomCompat();  RandomCompat(long seed);  RandomCompat(@NotNull Random random); @NotNull Random getRandom(); @NotNull IntStream ints(long streamSize); @NotNull LongStream longs(long streamSize); @NotNull DoubleStream doubles(long streamSize); @NotNull IntStream ints(); @NotNull LongStream longs(); @NotNull DoubleStream doubles(); @NotNull IntStream ints(long streamSize, final int randomNumberOrigin, final int randomNumberBound); @NotNull LongStream longs(long streamSize,
            final long randomNumberOrigin, final long randomNumberBound); @NotNull DoubleStream doubles(long streamSize,
            final double randomNumberOrigin, final double randomNumberBound); @NotNull IntStream ints(final int randomNumberOrigin, final int randomNumberBound); @NotNull LongStream longs(final long randomNumberOrigin, final long randomNumberBound); @NotNull DoubleStream doubles(final double randomNumberOrigin, final double randomNumberBound); }
RandomCompat { @NotNull public LongStream longs(long streamSize) { if (streamSize < 0L) throw new IllegalArgumentException(); if (streamSize == 0L) { return LongStream.empty(); } return longs().limit(streamSize); } RandomCompat();  RandomCompat(long seed);  RandomCompat(@NotNull Random random); @NotNull Random getRandom(); @NotNull IntStream ints(long streamSize); @NotNull LongStream longs(long streamSize); @NotNull DoubleStream doubles(long streamSize); @NotNull IntStream ints(); @NotNull LongStream longs(); @NotNull DoubleStream doubles(); @NotNull IntStream ints(long streamSize, final int randomNumberOrigin, final int randomNumberBound); @NotNull LongStream longs(long streamSize,
            final long randomNumberOrigin, final long randomNumberBound); @NotNull DoubleStream doubles(long streamSize,
            final double randomNumberOrigin, final double randomNumberBound); @NotNull IntStream ints(final int randomNumberOrigin, final int randomNumberBound); @NotNull LongStream longs(final long randomNumberOrigin, final long randomNumberBound); @NotNull DoubleStream doubles(final double randomNumberOrigin, final double randomNumberBound);  }