private void nodesToSlime(Set<Node.State> states, Cursor parentObject) {
        Cursor nodeArray = parentObject.setArray("nodes");
        nodeRepository.nodes().list()
                      .state(states)
                      .matching(filter)
                      .sortedBy(Comparator.comparing(Node::hostname))
                      .forEach(node -> toSlime(node, recursive, nodeArray.addObject()));
    }
Outputs the nodes in the given states to a node array
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/NodesResponse.java