net.jqwik.engine.properties.stateful.ComprehensiveListShrinkingCandidates Maven / Gradle / Ivy
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