Run android test in anonymous function