public List<Node> patchNodes(List<Node> nodes, UnaryOperator<Node> patcher) {
        List<Node> updated = new ArrayList<>();
        for (var node : nodes) {
            try (var lock = nodeRepository.nodes().lockAndGetRequired(node)) {
                node = patcher.apply(lock.node());
                nodeRepository.nodes().write(node, lock);
                updated.add(node);
            }
        }
        return updated;
    }
A test utility for provisioning tests.

@author bratseth
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java