### Question:
PressState extends State { void setDrawable(@NonNull StateDraweeView view, int key) { FrescoImageController.create() .load(getDrawable(key)) .into(view); }  @Override void attach(@NonNull final StateDraweeView view); @Override void detach(@NonNull final StateDraweeView view); static final int STATE_RELEASED; static final int STATE_PRESSED; }### Answer:
@Test public void test_SetDrawable() { StateDraweeView view = Mockito.spy(new StateDraweeView(RuntimeEnvironment.application)); PressState state = new PressState(); state.add(PressState.STATE_PRESSED, R.drawable.ui_ic_clear); state.add(PressState.STATE_RELEASED, R.drawable.ui_ic_clear); state.setDrawable(view, PressState.STATE_RELEASED); Mockito.verify(view).setController(Mockito.any(DraweeController.class)); }