AsyncResult<DataContext> () { AsyncResult<DataContext> result = new AsyncResult<>(); getDataContextFromFocusAsync() .onSuccess(context -> result.setDone(context)) .onError(it -> result.reject(it.getMessage())); return result; }