@Test
    public void saveDeviceScreenBitmap() throws IOException {
        writeToTestStorage(takeScreenshot(), getClass().getSimpleName() + "_" + nameRule.getMethodName());
    }
Captures and saves an image of the entire device screen to storage.
ui/espresso/ScreenshotSample/app/src/androidTest/java/com/example/android/testing/espresso/screenshotsample/ScreenshotJavaTest.java