class RuboCop::AST::NodePattern::Node::Union

def in_sequence_head

def in_sequence_head
  return unless children.any?(&:in_sequence_head)
  new_children = children.map do |child|
    next child unless (replace = child.in_sequence_head)
    if replace.size > 1
      Subsequence.new(:subsequence, replace, loc: child.loc)
    else
      replace.first
    end
  end
  [with(children: new_children)]
end