@Test
  public void testSetAlpha() {
    InOrder inOrder = inOrder(mLayers[0], mLayers[1], mLayers[2], mCallback);
    // reset drawable
    mFadeDrawable.reset();
    inOrder.verify(mCallback).invalidateDrawable(mFadeDrawable);
    // start animation
    mFadeDrawable.setTransitionDuration(85);
    mFadeDrawable.fadeUpToLayer(1);
    inOrder.verify(mCallback).invalidateDrawable(mFadeDrawable);
    // first frame
    mFadeDrawable.draw(mCanvas);
    inOrder.verify(mCallback, atLeastOnce()).invalidateDrawable(mFadeDrawable);
    // setAlpha
    mFadeDrawable.setAlpha(128);
    Assert.assertEquals(128, mFadeDrawable.getAlpha());
    inOrder.verify(mCallback).invalidateDrawable(mFadeDrawable);
    // next frame
    mFadeDrawable.incrementCurrentTimeMs(17);
    mFadeDrawable.draw(mCanvas);
    Assert.assertEquals(128, mFadeDrawable.getAlpha());
    Assert.assertEquals(255, mFadeDrawable.mAlphas[0]);
    Assert.assertEquals(255, mFadeDrawable.mAlphas[1]);
    Assert.assertEquals(204, mFadeDrawable.mAlphas[2]);
    Assert.assertEquals(FadeDrawable.TRANSITION_RUNNING, mFadeDrawable.mTransitionState);
    inOrder.verify(mLayers[0]).mutate();
    inOrder.verify(mLayers[0]).setAlpha(128);
    inOrder.verify(mLayers[0]).draw(mCanvas);
    inOrder.verify(mLayers[1]).draw(mCanvas);
    inOrder.verify(mCallback, atLeastOnce()).invalidateDrawable(mFadeDrawable);
    inOrder.verifyNoMoreInteractions();

    // make sure the fade has finished, and verify that after that we don't invalidate
    mFadeDrawable.incrementCurrentTimeMs(1000);
    mFadeDrawable.draw(mCanvas);
    inOrder.verify(mCallback, never()).invalidateDrawable(mFadeDrawable);
  }
Tests {@link FadeDrawable} where all layers are visible per default. * @see FadeDrawableTest for
more tests
drawee/src/test/java/com/facebook/drawee/drawable/FadeDrawableAllOnTest.java