Interface IteratorArbitrary<T>

  • All Superinterfaces:
    Arbitrary<java.util.Iterator<T>>, SizableArbitrary<java.util.Iterator<T>>, StreamableArbitrary<T,​java.util.Iterator<T>>

    @API(status=MAINTAINED,
         since="1.3.2")
    public interface IteratorArbitrary<T>
    extends StreamableArbitrary<T,​java.util.Iterator<T>>
    Fluent interface to add functionality to arbitraries that generate instances of type Iterator
    • Method Detail

      • uniqueElements

        @API(status=MAINTAINED,
             since="1.4.0")
        IteratorArbitrary<T> uniqueElements()
        Add the constraint that elements of the generated iterator must be unique, i.e. no two elements must return true when being compared using Object.equals(Object).

        The constraint can be combined with other uniqueElements(Function) constraints.

        Returns:
        new arbitrary instance
      • uniqueElements

        @API(status=MAINTAINED,
             since="1.4.0")
        IteratorArbitrary<T> uniqueElements​(java.util.function.Function<T,​java.lang.Object> by)
        Add the constraint that elements of the generated iterator must be unique relating to an element's "feature" being extracted using the by function. The extracted features are being compared using Object.equals(Object).

        The constraint can be combined with other uniqueElements(Function) constraints.

        Returns:
        new arbitrary instance