public List<Node> addNodesInState(LockedNodeList nodes, Node.State expectedState, Agent agent) {
        NestedTransaction transaction = new NestedTransaction();
        List<Node> writtenNodes = addNodesInState(nodes, expectedState, agent, transaction);
        transaction.commit();
        return writtenNodes;
    }
Adds a set of nodes. Rollbacks/fails transaction if any node is not in the expected state.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/persistence/CuratorDb.java