net.jqwik.engine.properties.arbitraries.StreamArbitrary Maven / Gradle / Ivy
package net.jqwik.engine.properties.arbitraries;
import java.util.*;
import java.util.stream.*;
import net.jqwik.api.*;
import net.jqwik.engine.properties.arbitraries.exhaustive.*;
public class StreamArbitrary extends DefaultCollectionArbitrary> {
public StreamArbitrary(Arbitrary elementArbitrary) {
super(elementArbitrary);
}
@Override
public RandomGenerator> generator(int genSize) {
return createListGenerator(genSize).map(Collection::stream);
}
@Override
public Optional>> exhaustive() {
return ExhaustiveGenerators.list(elementArbitrary, minSize, maxSize)
.map(generator -> generator.map(Collection::stream));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy