code: public <T> Stream<T> objects(final Class<T> type, final int streamSize) {
          if (streamSize < 0) {
              throw new IllegalArgumentException("The stream size must be positive");
          }
  
          return Stream.generate(() -> nextObject(type)).limit(streamSize);
      }
docs: Generate a stream of random instances of the given type.
  
  @param type           the type for which instances will be generated
  @param streamSize         the number of instances to generate
  @param <T>            the actual type of the target objects
  @return a stream of random instances of the given type
  @throws ObjectCreationException when unable to create a new instance of the given type