net.jqwik.vavr.arbitraries.collection.set.VavrTreeSetArbitrary Maven / Gradle / Ivy
package net.jqwik.vavr.arbitraries.collection.set;
import net.jqwik.vavr.NaturalComparator;
import net.jqwik.vavr.arbitraries.base.SetBasedArbitrary;
import io.vavr.collection.TreeSet;
import net.jqwik.api.Arbitrary;
import java.util.Comparator;
public class VavrTreeSetArbitrary extends SetBasedArbitrary> {
private final Comparator comparator;
public VavrTreeSetArbitrary(final Arbitrary elementArbitrary, final Comparator comparator) {
super(elementArbitrary);
this.comparator = comparator;
}
public VavrTreeSetArbitrary(final Arbitrary elementArbitrary) {
this(elementArbitrary, NaturalComparator.instance());
}
@Override
protected TreeSet convertJavaSetToVavrCollection(final java.util.Set javaSet) {
return TreeSet.ofAll(this.comparator, javaSet);
}
}