### Question:
TaskAdaptor extends QBeanSupport { protected void stopService () throws Exception { NameRegistrar.unregister (getName ()); if (task instanceof Destroyable) ((Destroyable)task).destroy (); } TaskAdaptor(); Object getObject();  }### Answer:
@Test public void testStopService() throws Throwable { TaskAdaptor taskAdaptor = new TaskAdaptor(); taskAdaptor.setName("testTaskAdaptorName"); taskAdaptor.stopService(); assertNull(taskAdaptor.task, "taskAdaptor.task"); assertEquals("testTaskAdaptorName", taskAdaptor.getName(), "taskAdaptor.getName()"); }