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

net.jqwik.engine.properties.ShrinkablesGenerator Maven / Gradle / Ivy

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

import java.util.*;
import java.util.function.*;

import net.jqwik.api.*;

public interface ShrinkablesGenerator extends Iterator> {

	default ShrinkablesGenerator andThen(Supplier generatorCreator) {
		ShrinkablesGenerator first = this;
		ShrinkablesGenerator afterSuccessGenerator = generatorCreator.get();
		return new ShrinkablesGenerator() {
			@Override
			public boolean hasNext() {
				if (first.hasNext()) {
					return true;
				}
				return afterSuccessGenerator.hasNext();
			}

			@Override
			public List next() {
				if (first.hasNext()) {
					return first.next();
				}
				return afterSuccessGenerator.next();
			}
		};
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy