title: Testing whether functions passed through function parameters are getting called (Android/Kotlin))
body: <p>Is there any way to check whether a function passed through another function's parameter is getting called? For example,</p>
  
  <pre><code>override fun updateWeight(value: Editable,
                            showEmptyError: () -&gt; Unit,
                            showOutOfRangeError: () -&gt; Unit,
                            dismissAlertDialog: () -&gt; Unit,
                            updateAndShow: (Float) -&gt; Unit) {
      if (value.toString().trim().isEmpty()) {
          showEmptyError()
      } else {
          val floatVal = value.toString().trim().toFloat()
          if (floatVal &gt; 300) {
              showOutOfRangeError()
          } else {
              dismissAlertDialog()
              updateAndShow(floatVal)
          }
      }
  }
  </code></pre>
  
  <p>I need to test above method with different values for <code>value</code> parameter and check which method is executing? I tried searching for an answer but I couldn't find a proper solution.</p>