@Test public void should_throw_exception_when_mvc_graph_clear_monitors_on_non_main_thread() throws Graph.IllegalRootComponentException { when(graph.uiThreadRunner.isOnUiThread()).thenReturn(false); graph.clearMonitors(); when(graph.uiThreadRunner.isOnUiThread()).thenReturn(true); graph.clearMonitors(); }