### Question:
FocusState extends BinaryState { @Override public void attach(@NonNull final StateDraweeView view) { view.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(final View v, final boolean hasFocus) { setDrawable((StateDraweeView) v); } }); setDrawable(view); }  @Override void attach(@NonNull final StateDraweeView view); @Override void detach(@NonNull final StateDraweeView view);  }### Answer:
@Test public void test_Attach() { StateDraweeView view = Mockito.spy(new StateDraweeView(RuntimeEnvironment.application)); FocusState state = new FocusState(); state.add(BinaryState.STATE_OFF, R.drawable.ui_ic_clear); state.attach(view); Mockito.verify(view).setOnFocusChangeListener(Mockito.any(View.OnFocusChangeListener.class)); }