@Override
        public boolean hasNext() {
            if (next != null) return true;

            // find next
            while (++i < 1<<nodes.size()) {
                int ones = Integer.bitCount(i);
                if (ones > maxLength) continue;

                next = new ArrayList<>(ones);
                for (int position = 0; position < nodes.size(); position++) {
                    if (hasOneAtPosition(position, i))
                        next.add(nodes.get(position));
                }
                return true;
            }
            return false;
        }
Finds the shortest sequence of moves which makes room for the given node on the given host,
assuming the given moves already made over the given hosts' current allocation.

@param node the node to make room for
@param host the target host to make room on
@param hosts the hosts onto which we can move nodes
@param movesConsidered the moves already being considered to add as part of this scenario
                       (after any moves made by this)
@param movesMade the moves already made in this scenario
@return the list of movesMade with the moves needed for this appended, in the order they should be performed,
        or null if no sequence could be found
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/SpareCapacityMaintainer.java