// Path: src/com/google/inject/testing/guiceberry/junit3/GuiceBerryEnvRemapper.java
// @Deprecated
// public interface GuiceBerryEnvRemapper {
// 
//     /**
//      * The name of the {@code System} property used to tell GuiceBerry 
//      * which {@link GuiceBerryEnvRemapper} (if any) to use.
//      */
//     String GUICE_BERRY_ENV_REMAPPER_PROPERTY_NAME = 
//         "GuiceBerryEnvRemapper";
// 
//     /**
//      * Returns the name of the 
//      * {@link com.google.inject.testing.guiceberry.GuiceBerryEnv} to be used in 
//      * place of the given {@code guiceBerryEnvName} for the given {@code testCase}.
//      * 
//      * <p>Note that the given {@code testCase} has not yet had its fields
//      * {@code @Injected}, since GuiceBerry requires the result of this
//      * method to choose the {@code Injector} to use.
//      */
//     String remap(TestCase testCase, String guiceBerryEnvName);
// }


import com.google.common.annotations.VisibleForTesting;
import com.google.inject.Module;
import com.google.inject.testing.guiceberry.junit3.GuiceBerryEnvRemapper;
      System.out.println(String.format(
          "********* ATTENTION ***********\n" +
          "I see you have the deprecated '%s' system property set, which is. " +
          "honored anymore. " +
          LINK_TO_UPGRADING_DOC,
          GuiceBerryEnvRemapper.GUICE_BERRY_ENV_REMAPPER_PROPERTY_NAME));
    }

    if (override != null) {
      return new DefaultEnvSelector(override.getName());
    } else {
      return new DefaultEnvSelector(guiceBerryEnvClazzName);
    }
  }
  
  public Class<? extends Module> guiceBerryEnvToUse(TestDescription testDescription) {
    Class<? extends Module> result = getGbeFromClazzName();
    Class<? extends Module> override = getOverride(result.getName());
    if (override != null) {
      result = override;
    }
    return result;
  }
  
  @VisibleForTesting
  @SuppressWarnings("unchecked")
  static Class<? extends Module> getOverride(String guiceBerryEnvName) {
    String overrideName = getOverrideName(guiceBerryEnvName);
    if (overrideName != null) {
      
// Path: src/com/google/inject/testing/guiceberry/junit3/GuiceBerryEnvRemapper.java
// @Deprecated
// public interface GuiceBerryEnvRemapper {
// 
//     /**
//      * The name of the {@code System} property used to tell GuiceBerry 
//      * which {@link GuiceBerryEnvRemapper} (if any) to use.
//      */
//     String GUICE_BERRY_ENV_REMAPPER_PROPERTY_NAME = 
//         "GuiceBerryEnvRemapper";
// 
//     /**
//      * Returns the name of the 
//      * {@link com.google.inject.testing.guiceberry.GuiceBerryEnv} to be used in 
//      * place of the given {@code guiceBerryEnvName} for the given {@code testCase}.
//      * 
//      * <p>Note that the given {@code testCase} has not yet had its fields
//      * {@code @Injected}, since GuiceBerry requires the result of this
//      * method to choose the {@code Injector} to use.
//      */
//     String remap(TestCase testCase, String guiceBerryEnvName);
// }


// Path: src/com/google/guiceberry/DefaultEnvSelector.java
import com.google.common.annotations.VisibleForTesting;
import com.google.inject.Module;
import com.google.inject.testing.guiceberry.junit3.GuiceBerryEnvRemapper;

      System.out.println(String.format(
          "********* ATTENTION ***********\n" +
          "I see you have the deprecated '%s' system property set, which is. " +
          "honored anymore. " +
          LINK_TO_UPGRADING_DOC,
          GuiceBerryEnvRemapper.GUICE_BERRY_ENV_REMAPPER_PROPERTY_NAME));
    }

    if (override != null) {
      return new DefaultEnvSelector(override.getName());
    } else {
      return new DefaultEnvSelector(guiceBerryEnvClazzName);
    }
  }
  
  public Class<? extends Module> guiceBerryEnvToUse(TestDescription testDescription) {
    Class<? extends Module> result = getGbeFromClazzName();
    Class<? extends Module> override = getOverride(result.getName());
    if (override != null) {
      result = override;
    }
    return result;
  }
  
  @VisibleForTesting
  @SuppressWarnings("unchecked")
  static Class<? extends Module> getOverride(String guiceBerryEnvName) {
    String overrideName = getOverrideName(guiceBerryEnvName);
    if (overrideName != null) {
      
      if (System.getProperty(GuiceBerryEnvRemapper.GUICE_BERRY_ENV_REMAPPER_PROPERTY_NAME) != null) {