code: private static LongStream generate(NumberGenerator generator, long count) {
      return LongStream.range(0, count).map(ignored -> generator.nextValue().longValue());
    }
docs: Returns a sequence of items constructed by the generator.