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

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

There is a newer version: 1.9.1
Show newest version
package net.jqwik.engine.properties.arbitraries;

import net.jqwik.api.*;

public class ArbitrariesSupport {
	public static int maxNumberOfElements(Arbitrary elementArbitrary, int defaultNumber) {
		return elementArbitrary
				   .exhaustive()
				   .map(generator -> {
					   long maxCount = generator.maxCount();
					   return (int) Math.min(maxCount, defaultNumber);
				   })
				   .orElse(defaultNumber);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy