public static <D extends Drawable> D mockDrawable(Class<D> drawableClassToMock) {
    D drawable = mock(drawableClassToMock);
    when(drawable.mutate()).thenReturn(drawable);
    stubGetAndSetBounds(drawable);
    stubGetAndSetCallback(drawable);
    stubSetVisibilityCallback(drawable);
    stubSetAlpha(drawable);
    stubGetPaint(drawable);
    stubGetBitmap(drawable);
    return drawable;
  }
Creates a mock Drawable with some methods stubbed.

@return mock Drawable
drawee/src/test/java/com/facebook/drawee/drawable/DrawableTestUtils.java