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

net.jqwik.engine.properties.stateful.ComprehensiveListShrinkingCandidates Maven / Gradle / Ivy

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

import java.util.*;

/**
 * It no longer implements {@code ShrinkingCandidates>} because its single use
 * in {@linkplain ShrinkableActionSequence} requires two different type signatures
 */
class ComprehensiveListShrinkingCandidates {

	public  Set> candidatesFor(List toShrink) {
		//At least one element will be kept
		if (toShrink.size() <= 1) {
			return Collections.emptySet();
		}
		Set> setOfSequences = new HashSet<>();
		for (int i = 0; i < toShrink.size(); i++) {
			ArrayList newCandidate = new ArrayList<>(toShrink);
			newCandidate.remove(i);
			setOfSequences.add(newCandidate);
		}
		return setOfSequences;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy