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