FoamDisabler { public void reenable(Application application) { if(application != null && application instanceof FoamApp){ FoamMain foamMain = ((FoamApp) application).getFoamMain(); if(foamMain != null){ foamMain.start(); } } }  void disable(Application application); void reenable(Application application);  }
@Test public void testReenable() { FoamDisabler foamDisabler = new FoamDisabler(); MockApplication mockApplication = new MockApplication(); FoamMain mockFoamMain = mockApplication.getFoamMain(); assertNotNull(mockFoamMain); foamDisabler.reenable(mockApplication); verify(mockFoamMain).start(); }