content: package <%= appPackage %>;
  
  import android.app.Application;
  import android.content.Context;
  
  import com.facebook.stetho.Stetho;
  import com.singhajit.sherlock.core.Sherlock;
  import com.squareup.leakcanary.LeakCanary;
  import com.tspoon.traceur.Traceur;
  
  import <%= appPackage %>.injection.component.AppComponent;
  import <%= appPackage %>.injection.component.DaggerAppComponent;
  import <%= appPackage %>.injection.module.AppModule;
  import <%= appPackage %>.injection.module.NetworkModule;
  import timber.log.Timber;
  
  public class MvpStarterApplication extends Application {
  
      private AppComponent appComponent;
  
      public static MvpStarterApplication get(Context context) {
          return (MvpStarterApplication) context.getApplicationContext();
      }
  
      @Override
      public void onCreate() {
          super.onCreate();
  
          if (BuildConfig.DEBUG) {
              Timber.plant(new Timber.DebugTree());
              Stetho.initializeWithDefaults(this);
              LeakCanary.install(this);
              Sherlock.init(this);
              Traceur.enableLogging();
          }
      }
  
      public AppComponent getComponent() {
          if (appComponent == null) {
              appComponent = DaggerAppComponent.builder()
                      .networkModule(new NetworkModule(this, BuildConfig.POKEAPI_API_URL))
                      .appModule(new AppModule(this))
                      .build();
          }
          return appComponent;
      }
  
      // Needed to replace the component with a test specific one
      public void setComponent(AppComponent appComponent) {
          this.appComponent = appComponent;
      }
  }
  