title: Kotlin unresolved reference :add after converting from Java code
body: <p>I had java code which looked like this:</p>
  
  <pre><code>    public static &lt;KEY, VALUE&gt; Map&lt;KEY, List&lt;VALUE&gt;&gt; createMultimap(@NonNull Collection&lt;VALUE&gt; values, @NonNull TransformFunction&lt;VALUE, KEY&gt; transformFunction) {
      Map&lt;KEY, List&lt;VALUE&gt;&gt; tmpMap = new HashMap&lt;&gt;();
      for (VALUE value : values) {
          if (value != null) {
              KEY key = transformFunction.transform(value);
              List&lt;VALUE&gt; valuesList = tmpMap.get(key);
              if (valuesList == null) {
                  valuesList = new ArrayList&lt;&gt;();
                  tmpMap.put(key, valuesList);
              }
              valuesList.add(value);
          }
      }
      return Collections.unmodifiableMap(tmpMap);
  }
  </code></pre>
  
  <p>I converted it using Android Studio option 'convert to Kotlin'</p>
  
  <p>Here what is look like:</p>
  
  <pre><code>    fun &lt;KEY, VALUE&gt; createMultimap(values: Collection&lt;VALUE&gt;, transformFunction: TransformFunction&lt;VALUE, KEY&gt;): Map&lt;KEY, List&lt;VALUE&gt;&gt; {
      val tmpMap = HashMap&lt;KEY, List&lt;VALUE&gt;&gt;()
      for (value in values) {
          if (value != null) {
              val key = transformFunction.transform(value)
              var valuesList: List&lt;VALUE&gt;? = tmpMap[key]
              if (valuesList == null) {
                  valuesList = ArrayList()
                  tmpMap.put(key, valuesList)
              }
              valuesList.add(value)
  
          }
      }
      return Collections.unmodifiableMap(tmpMap)
  }
  </code></pre>
  
  <p>The IDE now underlines the 'add' method here:</p>
  
  <pre><code>valuesList.add(value)
  </code></pre>
  
  <p>It says:</p>
  
  <blockquote>
    <p>unresolved reference :add</p>
  </blockquote>
  
  <p>How can i fix this?</p>
  
  <p>UPDATE:</p>
  
  <p>Here is my transform function:</p>
  
  <pre><code>    interface TransformFunction&lt;VALUE, RESULT&gt; {
      fun transform(value: VALUE?): RESULT
  }
  </code></pre>
  
  <p>Sample usage:</p>
  
  <pre><code>    private fun getRSSIMultimap(rssiEvents: Collection&lt;LocationRSSIEvent&gt;): Map&lt;NexoIdentifier, List&lt;LocationRSSIEvent&gt;&gt; {
      return CollectionsUtils.createMultimap(rssiEvents, object : CollectionsUtils.TransformFunction&lt;LocationRSSIEvent, NexoIdentifier&gt; {
          override fun transform(locationRSSIEvent: LocationRSSIEvent): NexoIdentifier {
              return locationRSSIEvent.nexoIdentifier
          }
      })
  }
  </code></pre>