### Question:
UI extends QBeanSupport implements UIObjectFactory { public void stopService () { NameRegistrar.unregister (getName()); if (ui != null) ui.dispose (); } UI(); void startService(); void stopService(); Object newInstance(String clazz);  }### Answer:
@Test public void testStopService() throws Throwable { UI uI = new UI(); uI.setName("ui"); uI.stopService(); assertNull(uI.ui, "uI.ui"); }