class Dependabot::FileParsers::Base::DependencySet::DependencySlot

def <<(dep)

def <<(dep)
  return self if @all_versions.include?(dep)
  @combined = if @combined
                combined_dependency(@combined, dep)
              else
                dep
              end
  index_of_same_version =
    @all_versions.find_index { |other| other.version == dep.version }
  if index_of_same_version.nil?
    @all_versions << dep
  else
    same_version = @all_versions[index_of_same_version]
    @all_versions[index_of_same_version] = combined_dependency(T.must(same_version), dep)
  end
  self
end