Logic for the below problem statement:
Oh, that's a good point @dmahapatro. Occasionally a user may go Busy while working on a call, and I'll want to get any Accepted statuses that occur before the Busy but after the Ready ("before" being "to the right of"), AND not get the Busy either. So, I suppose I'll need to do statusDescription != 'Ready' and statusDescription != 'Busy' or so. Code sure would be a lot cleaner without people having to use it!
def list = ['A', 'A', 'A', 'R', 'A', 'A','B', 'A']
def statusBeforeBusy = list.takeWhile{ it != 'B'}
println "Statuses before Busy: $statusBeforeBusy" //[A, A, A, R, A, A]
def statusBeforeReady = list.takeWhile{ it != 'R'}
println "Statuses before Ready: $statusBeforeReady" //[A, A, A]
def statusaAfterReadyBeforeBusy = statusBeforeBusy.dropWhile{ it != 'R'}.tail()
println "Statuses After Ready before Busy: $statusaAfterReadyBeforeBusy" //[A, A]