RemoveView { protected void destroy() { if (layout != null && layout.getParent() != null) { windowManager.removeView(layout); } layout = null; windowManager = null; } protected  RemoveView(Context context);   }
@Test public void testDestroy() { assertNotNull("layout field must not be null before destroy method call", getInternalState(removeView, "layout")); assertNotNull("mWindowManager field must not be null before destroy method call", getInternalState(removeView, "windowManager")); removeView.destroy(); assertNull("layout field must be set to null after destroy method call", getInternalState(removeView, "layout")); assertNull("mWindowManager field must be set to null after destroy method call", getInternalState(removeView, "windowManager")); }