// Path: compiler/src/test/resources/ActivityBuilder/emptyActivity/EmptyActivity.java
// @Builder
// public class EmptyActivity extends Activity {
// }
// 
// Path: compiler/src/test/resources/ActivityBuilder/emptyActivity/EmptyActivityBuilder.java
// public class EmptyActivityBuilder<A extends Activity> extends BaseActivityBuilder<EmptyActivityBuilder<A>, A> {
//   private EmptyActivityBuilder(A activity) {
//     super(activity);
//     setIntent(new Intent(activity, EmptyActivity.class));
//   }
// 
//   public static <A extends Activity> EmptyActivityBuilder<A> create(A activity) {
//     return new EmptyActivityBuilder<A>(activity);
//   }
// 
//   @Override
//   protected EmptyActivityBuilder<A> self() {
//     return this;
//   }
// }
// 
// Path: compiler/src/test/resources/ActivityBuilder/emptyActivity/EmptyActivityHelper.java
// public class EmptyActivityHelper {
//   private final EmptyActivity activity;
// 
//   public EmptyActivityHelper(EmptyActivity activity) {
//     this(activity, false)
//   }
// 
//   public EmptyActivityHelper(EmptyActivity activity, boolean autoInject) {
//     this.activity = activity;
//     if (autoInject) {
//       inject();
//     }
//   }
// 
//   void inject() {
//     Intent intent = activity.getIntent();
//   }
// 
//   void restore(Bundle savedInstanceState) {
//   }
// 
//   void save(Bundle savedInstanceState) {
//   }
// }


import android.app.Activity;
import android.content.Intent;
import java.lang.Class;
import java.lang.IllegalAccessException;
import java.lang.NoSuchMethodException;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import test.EmptyActivity;
import test.EmptyActivityBuilder;
import test.EmptyActivityHelper;
package info.dourok.esactivity;


public class BuilderUtil {
  private static final HashMap<Class<? extends Activity>, Class<? extends BaseActivityBuilder>>
      sBuilderMap = new HashMap<>();

  static {
    sBuilderMap.put(EmptyActivity.class, EmptyActivityBuilder.class);
  }

  public static <A extends Activity> BaseActivityBuilder<? extends BaseActivityBuilder, A> createBuilder(
      A activity,
      Class<? extends Activity> clazz) {
    return BaseActivityBuilder.create(activity, clazz);
  }

  public static <A extends Activity> BaseActivityBuilder<? extends BaseActivityBuilder, A> createBuilder(
      A activity,
      Intent intent) {
    return BaseActivityBuilder.create(activity, intent);
  }

  public static <A extends Activity, T extends BaseActivityBuilder<T, A>> T smallCreate(A activity,
      Class<? extends Activity> clazz) {
    if (sBuilderMap.containsKey(clazz)) {
      try {
        return (T) sBuilderMap.get(clazz)
// Path: compiler/src/test/resources/ActivityBuilder/emptyActivity/EmptyActivity.java
// @Builder
// public class EmptyActivity extends Activity {
// }
// 
// Path: compiler/src/test/resources/ActivityBuilder/emptyActivity/EmptyActivityBuilder.java
// public class EmptyActivityBuilder<A extends Activity> extends BaseActivityBuilder<EmptyActivityBuilder<A>, A> {
//   private EmptyActivityBuilder(A activity) {
//     super(activity);
//     setIntent(new Intent(activity, EmptyActivity.class));
//   }
// 
//   public static <A extends Activity> EmptyActivityBuilder<A> create(A activity) {
//     return new EmptyActivityBuilder<A>(activity);
//   }
// 
//   @Override
//   protected EmptyActivityBuilder<A> self() {
//     return this;
//   }
// }
// 
// Path: compiler/src/test/resources/ActivityBuilder/emptyActivity/EmptyActivityHelper.java
// public class EmptyActivityHelper {
//   private final EmptyActivity activity;
// 
//   public EmptyActivityHelper(EmptyActivity activity) {
//     this(activity, false)
//   }
// 
//   public EmptyActivityHelper(EmptyActivity activity, boolean autoInject) {
//     this.activity = activity;
//     if (autoInject) {
//       inject();
//     }
//   }
// 
//   void inject() {
//     Intent intent = activity.getIntent();
//   }
// 
//   void restore(Bundle savedInstanceState) {
//   }
// 
//   void save(Bundle savedInstanceState) {
//   }
// }


// Path: compiler/src/test/resources/ActivityBuilder/emptyActivity/BuilderUtil.java
import android.app.Activity;
import android.content.Intent;
import java.lang.Class;
import java.lang.IllegalAccessException;
import java.lang.NoSuchMethodException;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import test.EmptyActivity;
import test.EmptyActivityBuilder;
import test.EmptyActivityHelper;

package info.dourok.esactivity;


public class BuilderUtil {
  private static final HashMap<Class<? extends Activity>, Class<? extends BaseActivityBuilder>>
      sBuilderMap = new HashMap<>();

  static {
    sBuilderMap.put(EmptyActivity.class, EmptyActivityBuilder.class);
  }

  public static <A extends Activity> BaseActivityBuilder<? extends BaseActivityBuilder, A> createBuilder(
      A activity,
      Class<? extends Activity> clazz) {
    return BaseActivityBuilder.create(activity, clazz);
  }

  public static <A extends Activity> BaseActivityBuilder<? extends BaseActivityBuilder, A> createBuilder(
      A activity,
      Intent intent) {
    return BaseActivityBuilder.create(activity, intent);
  }

  public static <A extends Activity, T extends BaseActivityBuilder<T, A>> T smallCreate(A activity,
      Class<? extends Activity> clazz) {
    if (sBuilderMap.containsKey(clazz)) {
      try {
        return (T) sBuilderMap.get(clazz)
            .getMethod("create", Activity.class)