@Override protected void doRunExample(final Engine engine) throws Exception { final MockService<String> httpClient = getService(); final Task<String> fetch = fetchUrl(httpClient, "http://www.google.com"); final Task<String> fetchWithTimeout = timeoutWithError(50, TimeUnit.MILLISECONDS, fetch); engine.run(fetchWithTimeout); fetchWithTimeout.await(); System.out.println(!fetchWithTimeout.isFailed() ? "Received result: " + fetchWithTimeout.get() : "Error: " + fetchWithTimeout.getError()); ExampleUtil.printTracingResults(fetchWithTimeout); } }