}
@Override
public ResetContextHandle setup() throws IllegalStateException {
final LinkedList<ResetContextHandle> resetHandles = new LinkedList<>();
final ResetContextHandle resetContextHandle = new ChainedResetContextHandle(resetHandles);
try {
ConcurrentContext.pushCurrent(concurrentContext);
for (SetupContextHandle handle : setupHandles) {
resetHandles.addFirst(handle.setup());
}
} catch (Error | RuntimeException e) {
resetContextHandle.reset();
throw e;
}
return resetContextHandle;
}