@Test
public void testWritesJpeg() {

	File file = new File(getContext().getCacheDir(), "test_file");
	Bitmap bitmap = Bitmap.createBitmap(200, 200, Bitmap.Config.RGB_565);
	BitmapWriter writer = new BitmapWriter(bitmap);
	boolean result = writer.write(file);
	Assert.assertTrue(result);
	ShadowBitmapFactory.provideWidthAndHeightHints(file.getAbsolutePath(), 200, 200);
	Bitmap writtenBitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
	Assert.assertNotNull(writtenBitmap);
	Assert.assertEquals(bitmap.getWidth(), writtenBitmap.getWidth());
	Assert.assertEquals(bitmap.getHeight(), writtenBitmap.getHeight());
	// ShadowBitmapFactory doesn't save the state of the bitmap.
	// Can't test this with robolectric it seems
/		Assert.assertTrue(writtenBitmap.hasAlpha());
}