net.jqwik.engine.properties.stateful.ShrinkablesActionGenerator Maven / Gradle / Ivy
package net.jqwik.engine.properties.stateful;
import java.util.*;
import net.jqwik.api.*;
import net.jqwik.api.stateful.*;
class ShrinkablesActionGenerator implements ActionGenerator {
private Iterator>> iterator;
private List>> shrinkables = new ArrayList<>();
ShrinkablesActionGenerator(List>> shrinkables) {
iterator = shrinkables.iterator();
}
@Override
public Action next(T model) {
while (iterator.hasNext()) {
Shrinkable> next = iterator.next();
if (!next.value().precondition(model)) {
continue;
}
shrinkables.add(next);
return next.value();
}
throw new NoSuchElementException("No more actions available");
}
@Override
public List>> generated() {
return shrinkables;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy