title: wait till lateinit is assigned
body: <p>I have a simple class which I use for dependency injection:</p>
  
  <pre><code>class ViewModelFactory( application: Application ) : ViewModelProvider.Factory
  {
  
      val mainFlow                  = MainFlow()
      private val authorizationFlow = AuthorizationFlow()
  
      init
      {
          mainFlow.authFlow = authorizationFlow
      }
  
      ..
  }
  </code></pre>
  
  <p>The main flow class:</p>
  
  <pre><code>class MainFlow
  {
      lateinit var authFlow : AuthorizationFlow
  
      init
      {
          if( ::authFlow.isInitialized )
              authFlow.start()
      }
  }
  </code></pre>
  
  <p>And the authorization flow</p>
  
  <pre><code>class AuthorizationFlow
  {
      fun start()
      {
          // do some stuff
      }
  }
  </code></pre>
  
  <p>The obvious problem is that the authFlow property within the MainFlow class is never initialized when the <em>init</em> gets executed. How can I "wait" for the authFlow to become initialized and only then call the authFlow.start() method? Thanks!</p>