title: Kotlin delegation, what should I test?
body: <p>In Kotlin the powerful construct of delegation can be used to extend functionality of existing interfaces by reusing existing implementations.</p>
  
  <pre><code>class Demo : Map by HashMap {}
  </code></pre>
  
  <p>Questions:</p>
  
  <ul>
  <li>What should I be testing? Testing hashmap from the example is not the target of this test. It seems very verbose to verify the complete implementation, I would rather like to verify that the delegation of the proper fields take place.</li>
  <li>When using mutation testing, e.g. using <a href="http://pitest.org" rel="nofollow noreferrer">PItest</a>, how do I catch all mutations? The report shows quite a few mutations, correctly I believe. The Kotlin compiler creates byte code for all delegations.</li>
  </ul>