Optimization in any(); tests for synchronous any() and all()