private String lastElement(String path) {
        if (path.endsWith("/"))
            path = path.substring(0, path.length()-1);
        int lastSlash = path.lastIndexOf("/");
        if (lastSlash < 0) return path;
        return path.substring(lastSlash+1);
    }
Outputs the nodes in the given states to a node array
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/restapi/NodesResponse.java