Code from Android Testing class