package com.github.pedrovgs.effectiveandroidui;

import android.app.Application;
import com.github.pedrovgs.effectiveandroidui.di.RootModule;
import dagger.ObjectGraph;

/**
 * Android Application extension created to get the control of the application lifecycle.
 * <p/>
 * This project is using Dependency Injection based on Dagger as dependency injector. The
 * ObjectGraph field used in this class is the dependency container that is going to provide every
 * dependency declared in Dagger modules.
 *
 * @author Pedro Vicente Gómez Sánchez
 */
public class TvShowsApplication extends Application {

  private ObjectGraph objectGraph;

  @Override
  public void onCreate() {
    super.onCreate();
    initializeDependencyInjector();
  }

  /**
   * Inject every dependency declared in the object with the @Inject annotation if the dependency
   * has been already declared in a module and already initialized by Dagger.
   *
   * @param object to inject.
   */
  public void inject(Object object) {
    objectGraph.inject(object);
  }

  /**
   * Extend the dependency container graph will new dependencies provided by the modules passed as
   * arguments.
   *
   * @param objects modules used to populate the dependency container.
   */
  public void plus(Object... objects) {
    objectGraph.plus(objects);
  }

  private void initializeDependencyInjector() {
    objectGraph = ObjectGraph.create(new RootModule());
    objectGraph.inject(this);
    objectGraph.injectStatics();
  }
}

@@ -161,16 +161,39 @@
 ctGraph;
+%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -1198,16 +1198,8 @@
 ram 
-objects 
 modu
@@ -1274,29 +1274,229 @@
 lus(
+List%3C
 Object
-... object
+%3E modules) %7B%0A    if (modules == null) %7B%0A      throw new IllegalArgumentException(%0A          %22You can't plus a null module, review your getModules() implementation%22);%0A    %7D%0A    for (Object module : module
 s) %7B%0A
+  
     
@@ -1516,17 +1516,23 @@
 lus(
-objects);
+modules);%0A    %7D
 %0A  %7D

Refactor TvShowsApplication to improve plus method