### Question:
Service { public void unadvertiseService() { this.ros.deregisterCallServiceCallback(this.name); JsonObject call = Json.createObjectBuilder() .add(JRosbridge.FIELD_OP, JRosbridge.OP_CODE_UNADVERTISE_SERVICE) .add(JRosbridge.FIELD_SERVICE, this.name).build(); this.ros.send(call); this.isAdvertised = false; } Service(Ros ros, String name, String type); Ros getRos(); String getName(); String getType(); boolean isAdvertised(); void callService(ServiceRequest request, ServiceCallback cb); void sendResponse(ServiceResponse response, String id); void advertiseService(CallServiceCallback cb); void unadvertiseService(); synchronized ServiceResponse callServiceAndWait(
			ServiceRequest request);  }### Answer:
@Test public void testUnadvertiseService() { s1.unadvertiseService(); while (DummyHandler.latest == null) { Thread.yield(); } assertNotNull(DummyHandler.latest); assertEquals( "{\"op\":\"unadvertise_service\",\"service\":\"myService\"}", DummyHandler.latest.toString()); assertFalse(s1.isAdvertised()); }