@Test
public void transform_withBitmapDrawable_andUnitBitmapTransformation_doesNotRecycle() {
when(
bitmapTransformation
.transform(
any(Context.class), anyBitmapResource(), anyInt(), anyInt()))
.thenAnswer(new ReturnGivenResource());
Bitmap bitmap = Bitmap.createBitmap(100, 200, Bitmap.Config.ARGB_8888);
BitmapDrawable drawable = new BitmapDrawable(context.getResources(), bitmap);
@SuppressWarnings("unchecked")
Resource<Drawable> input =
(Resource<Drawable>) (Resource<?>) new BitmapDrawableResource(drawable, bitmapPool);
transformation.transform(context, input, 100, 200);
assertThat(bitmap.isRecycled()).isFalse();
}