All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.jqwik.engine.properties.arbitraries.IteratorArbitrary Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
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