### Question:
ThingsAgent implements ThingsService { @Override public IFuture<Void> destroy(String id) { IExternalAccess thingAgent = children.get(id); Future<Void> result = new Future(); thingAgent.killComponent().addResultListener(r -> result.setResult(null), result::setException); return result; } ThingsAgent();   ThingsAgent(IInternalAccess agent,
                Map<String, ExposedThing> things,
                Map<String, IExternalAccess> children); @AgentCreated void created(); @Override IFuture<IExternalAccess> expose(String id); @Override IFuture<Void> destroy(String id);  }### Answer:
@Test public void destroyShouldDestroyThingAgent() { when(children.get(any())).thenReturn(externalAccess); when(externalAccess.killComponent()).thenReturn(mock(IFuture.class)); ThingsAgent agent = new ThingsAgent(ia, things, children); agent.destroy("counter"); verify(externalAccess).killComponent(); }