@Test
public void showModal_previousModalIsRemovedFromHierarchy() {

    uut.showModal(modal1, null, new CommandListenerAdapter() {
        @Override
        public void onSuccess(String childId) {
            uut.showModal(modal2, modal1, new CommandListenerAdapter() {
                @Override
                public void onSuccess(String childId) {
                    assertThat(modal1.getView().getParent()).isNull();
                    verify(modal1, times(1)).onViewDisappear();
                }
            });
            assertThat(modal1.getView().getParent()).isEqualTo(modal2.getView().getParent());
        }
    });
}