public static void stubGetPaint(Drawable drawable) {
    if (!(drawable instanceof BitmapDrawable)) {
      return;
    }
    BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable;
    final Paint paint = new Paint();
    // NULLSAFE_FIXME[Not Vetted Third-Party]
    when(bitmapDrawable.getPaint()).thenReturn(paint);
    doAnswer(
            new Answer<Void>() {
              @Override
              public Void answer(InvocationOnMock invocation) throws Throwable {
                paint.setColorFilter((ColorFilter) invocation.getArguments()[0]);
                return null;
              }
            })
        .when(bitmapDrawable)
        .setColorFilter(any(ColorFilter.class));
  }
Stubs getPaint for BitmapDrawables.

@param drawable drawable to stub methods of
drawee/src/test/java/com/facebook/drawee/drawable/DrawableTestUtils.java