@NotNull
    private static DBNNode[][] groupConsecutiveNodes(@NotNull List<DBNNode> nodes) {
        final List<DBNNode[]> ranges = new ArrayList<>();
        final List<DBNNode> range = new ArrayList<>();

        for (int index = 1, length = nodes.size(); index <= length; index++) {
            range.add(nodes.get(index - 1));
            if (index == length || getNodePosition(nodes.get(index - 1)) != getNodePosition(nodes.get(index)) - 1) {
                ranges.add(range.toArray(new DBNNode[0]));
                range.clear();
            }
        }

        return ranges.toArray(new DBNNode[0][]);
    }
Performs grouping of a consecutive nodes.

@param nodes nodes to group
@return an array of arrays containing consecutive nodes
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/actions/NavigatorHandlerObjectMove.java