Task task = (Task) value;
    if (task.isDone() && !task.isError()) {
        value = task.getUnchecked();
    } else {
        // TODO how to record a completed but errored task?
        value = null;
    }