### Question:
Service { public synchronized ServiceResponse callServiceAndWait( ServiceRequest request) { BlockingCallback cb = new BlockingCallback(this); this.callService(request, cb); while (cb.getResponse() == null) { try { this.wait(); } catch (InterruptedException e) { e.printStackTrace(System.out); } } return cb.getResponse(); } 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 testCallServiceAndWait() { ServiceRequest req = new ServiceRequest("{\"test1\":\"test2\"}"); Timer timer = new Timer(); timer.schedule(new SendServiceResponse(ros), 1500); ServiceResponse resp = s1.callServiceAndWait(req); assertNotNull(resp); assertEquals("{\"test3\":\"test4\"}", resp.toString()); }