private void processEvent(final CuratorEvent curatorEvent) { validateConnection(curatorEvent); listeners.forEach( new Function<CuratorListener, Void>() { @Override public Void apply(CuratorListener listener) { try { TimeTrace trace = client.startTracer("EventListener"); listener.eventReceived(CuratorFrameworkImpl.this, curatorEvent); trace.commit(); } catch (Exception e) { logError("Event listener threw exception", e); } return null; } }); }