title: Error "None of the following functions can be called with the arguments supplied.:
body: <p>I've been working on learning RecyclerViews in Kotlin and have become stuck on a specific error that I can't seem to work around:</p>
  <p><code>val itemsHashSet = HashSet(category.items)</code></p>
  <p>produces an error:</p>
  <blockquote>
  <p>None of the following functions can be called with the arguments supplied.
  ((MutableCollection&lt;out TypeVariable(E)!&gt;..Collection&lt;TypeVariable(E)!&gt;?))   where E = TypeVariable(E) for    fun  (c: (MutableCollection&lt;out E!&gt;..Collection&lt;E!&gt;?)): kotlin.collections.HashSet /* = java.util.HashSet <em>/ defined in kotlin.collections.HashSet
  (Int)   where E = TypeVariable(E) for    fun  (initialCapacity: Int): kotlin.collections.HashSet /</em> = java.util.HashSet */ defined in kotlin.collections.HashSet</p>
  </blockquote>
  <p>I've tried changing the format and even writing the code in Java and then converting it in Android Studio to no avail.</p>
  <p>Here's the Class I've been stuck on:</p>
  <pre><code>class CategoryManager(private val context: Context) {
  
      fun saveCategory(category: CategoryModel) {
  
          val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
          val editor = sharedPreferences.edit()
  
          val itemsHashSet = HashSet(category.items)
  
          editor.putStringSet(category.name, itemsHashSet)
  
          editor.apply()
      }
  
      fun retrieveCategories (): ArrayList&lt;CategoryModel&gt; {
  
          val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
          val data = sharedPreferences.all
  
          val categories = ArrayList&lt;CategoryModel&gt;()
  
          for (item in data) {
  
              val category = CategoryModel(item.key, arrayListOf(item.value.toString()))
  
              categories.add(category)
  
          }
  
          return categories
  
      }
  }
  </code></pre>
  <p>I'm sorry if I'm a moron and this is obvious, but I can't find an applicable answer here that makes sense. Any help is appreciated</p>
  <p>EDIT:</p>
  <p>Category Model:</p>
  <pre><code>package com.pwneill.favoritelistapp
  
  class CategoryModel (name: String, items: ArrayList&lt;String&gt;) {
  
       val name = name
       val items = arrayOf(items)
  
  }
  </code></pre>