### Question:
LevelState extends State { @Override public void detach(@NonNull final StateDraweeView view) { view.setOnLevelListener(null); } LevelState(int defaultLevel, @DrawableRes int defaultRes); @Override void attach(@NonNull final StateDraweeView view); @Override void detach(@NonNull final StateDraweeView view); @Override String toString();  }### Answer:
@Test public void test_Detach() { StateDraweeView view = Mockito.spy(new StateDraweeView(RuntimeEnvironment.application)); LevelState state = new LevelState(0, R.drawable.ui_ic_clear); state.detach(view); Mockito.verify(view).setOnLevelListener(null); }