public Node writeTo(Node.State toState, Node node, Agent agent, Optional<String> reason) {
        return writeTo(toState, List.of(node), agent, reason).get(0);
    }
Writes the given nodes to the given state (whether they are already in this state or another),
and returns a copy of the incoming nodes in their persisted state.

@param  toState the state to write the nodes to
@param  nodes the list of nodes to write
@param  agent the agent causing this change
@return the nodes in their persisted state
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDb.java