val idSequence = new AtomicLong(0);
//in 'before' hook, idSequence is loaded with a Long value from a file
val firstFeeder = Iterator.continually(Map("first" -> {
var next: Long = idSequence.incrementAndGet()
// do some processing on next and return
next;
}))
val secondFeeder = Iterator.continually(Map("second" -> {
var curr: Long = idSequence.get() //this doesn't return correct value because idSequence is also used by other users
// do some processing on curr and return
curr;
}))
//in my scenario(), the feeders are fed like this
.feed(firstFeeder)
.exec(somethingThatUsesNext)
.feed(secondFeeder)
.exec(somethingThatUsesCurr)
//in 'after' hook, once test is finished, the last used idSequence is written back to the file to use for next execution