com.natpryce.makeiteasy.sequence.ElementsSequence Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of make-it-easy Show documentation
Show all versions of make-it-easy Show documentation
A tiny framework that makes it easy to write Test Data Builders in Java
package com.natpryce.makeiteasy.sequence;
import com.natpryce.makeiteasy.Donor;
import java.util.Iterator;
public class ElementsSequence implements Donor {
private final Iterable nextElements;
private Iterator current;
public ElementsSequence(Iterable firstElements, Iterable nextElements) {
this.nextElements = nextElements;
this.current = firstElements.iterator();
}
@Override
public T value() {
if (!current.hasNext()) {
current = nextElements.iterator();
}
return current.next();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy