// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/DefaultEnvironment.java
// public class DefaultEnvironment extends ImmutableEnvironment {
//   /**
//    * Constructs environment named "" (empty string).
//    */
//   public DefaultEnvironment() {
//     super("");
//   }
// 
//   @Override
//   public String toString() {
//     return "DefaultEnvironment{}";
//   }
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/Environment.java
// public interface Environment {
// 
//   /**
//    * Name of the environment. Should not be null.
//    *
//    * @return environment name. Not null.
//    */
//   String getName();
// 
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/ImmutableEnvironment.java
// public class ImmutableEnvironment implements Environment {
// 
//   private final String envName;
// 
//   /**
//    * Construct environment named {@code envName}. This name never changes.
//    *
//    * @param envName environment name to use
//    */
//   public ImmutableEnvironment(String envName) {
//     this.envName = requireNonNull(envName);
//   }
// 
//   @Override
//   public String getName() {
//     return envName;
//   }
// 
//   @Override
//   public String toString() {
//     return "ImmutableEnvironment{" +
//         "envName='" + envName + '\'' +
//         '}';
//   }
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/MissingEnvironmentException.java
// public class MissingEnvironmentException extends RuntimeException {
// 
//   private static final String MISSING_ENV_MSG = "Missing environment: ";
// 
//   /**
//    * Environment named {@code envName} is missing.
//    *
//    * @param envName environment name
//    */
//   public MissingEnvironmentException(String envName) {
//     super(MISSING_ENV_MSG + envName);
//   }
// 
//   /**
//    * Environment named {@code envName} is missing.
//    *
//    * @param envName environment name
//    * @param cause root cause
//    */
//   public MissingEnvironmentException(String envName, Throwable cause) {
//     super(MISSING_ENV_MSG + envName, cause);
//   }
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/filesprovider/ConfigFilesProvider.java
// public interface ConfigFilesProvider {
// 
//   /**
//    * Provide a list of configuration files to use.
//    * @return {@link Iterable} of configuration {@link File}s to use
//    */
//   Iterable<Path> getConfigFiles();
// 
// }


import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.assertj.core.data.MapEntry;
import org.cfg4j.source.context.environment.DefaultEnvironment;
import org.cfg4j.source.context.environment.Environment;
import org.cfg4j.source.context.environment.ImmutableEnvironment;
import org.cfg4j.source.context.environment.MissingEnvironmentException;
import org.cfg4j.source.context.filesprovider.ConfigFilesProvider;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
    Environment environment = new ImmutableEnvironment("otherApplicationConfigs");

    assertThat(source.getConfiguration(environment)).containsOnly(MapEntry.entry("some.setting", "otherAppSetting"));
  }

  @Test
  void getConfigurationDisallowsLeadingSlashInClasspathLocation() {
    Environment environment = new ImmutableEnvironment("/otherApplicationConfigs");

    assertThatThrownBy(() -> source.getConfiguration(environment)).isExactlyInstanceOf(MissingEnvironmentException.class);
  }

  @Test
  void getConfigurationReadsFromGivenFiles() {
    configFilesProvider = () -> Arrays.asList(
        Paths.get("application.properties"),
        Paths.get("otherConfig.properties")
    );

    source = new ClasspathConfigurationSource(configFilesProvider);
    assertThat(source.getConfiguration(new DefaultEnvironment())).containsOnlyKeys("some.setting", "otherConfig.setting");
  }

  @Test
  void getConfigurationThrowsOnMissingEnvironment() {
    assertThatThrownBy(() -> source.getConfiguration(new ImmutableEnvironment("awlerijawoetinawwerlkjn"))).isExactlyInstanceOf(MissingEnvironmentException.class);
  }

  @Test
  void getConfigurationThrowsOnMissingConfigFile() {
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/DefaultEnvironment.java
// public class DefaultEnvironment extends ImmutableEnvironment {
//   /**
//    * Constructs environment named "" (empty string).
//    */
//   public DefaultEnvironment() {
//     super("");
//   }
// 
//   @Override
//   public String toString() {
//     return "DefaultEnvironment{}";
//   }
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/Environment.java
// public interface Environment {
// 
//   /**
//    * Name of the environment. Should not be null.
//    *
//    * @return environment name. Not null.
//    */
//   String getName();
// 
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/ImmutableEnvironment.java
// public class ImmutableEnvironment implements Environment {
// 
//   private final String envName;
// 
//   /**
//    * Construct environment named {@code envName}. This name never changes.
//    *
//    * @param envName environment name to use
//    */
//   public ImmutableEnvironment(String envName) {
//     this.envName = requireNonNull(envName);
//   }
// 
//   @Override
//   public String getName() {
//     return envName;
//   }
// 
//   @Override
//   public String toString() {
//     return "ImmutableEnvironment{" +
//         "envName='" + envName + '\'' +
//         '}';
//   }
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/environment/MissingEnvironmentException.java
// public class MissingEnvironmentException extends RuntimeException {
// 
//   private static final String MISSING_ENV_MSG = "Missing environment: ";
// 
//   /**
//    * Environment named {@code envName} is missing.
//    *
//    * @param envName environment name
//    */
//   public MissingEnvironmentException(String envName) {
//     super(MISSING_ENV_MSG + envName);
//   }
// 
//   /**
//    * Environment named {@code envName} is missing.
//    *
//    * @param envName environment name
//    * @param cause root cause
//    */
//   public MissingEnvironmentException(String envName, Throwable cause) {
//     super(MISSING_ENV_MSG + envName, cause);
//   }
// }
// 
// Path: cfg4j-core/src/main/java/org/cfg4j/source/context/filesprovider/ConfigFilesProvider.java
// public interface ConfigFilesProvider {
// 
//   /**
//    * Provide a list of configuration files to use.
//    * @return {@link Iterable} of configuration {@link File}s to use
//    */
//   Iterable<Path> getConfigFiles();
// 
// }


// Path: cfg4j-core/src/test/java/org/cfg4j/source/classpath/ClasspathConfigurationSourceTest.java
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.assertj.core.data.MapEntry;
import org.cfg4j.source.context.environment.DefaultEnvironment;
import org.cfg4j.source.context.environment.Environment;
import org.cfg4j.source.context.environment.ImmutableEnvironment;
import org.cfg4j.source.context.environment.MissingEnvironmentException;
import org.cfg4j.source.context.filesprovider.ConfigFilesProvider;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;

    Environment environment = new ImmutableEnvironment("otherApplicationConfigs");

    assertThat(source.getConfiguration(environment)).containsOnly(MapEntry.entry("some.setting", "otherAppSetting"));
  }

  @Test
  void getConfigurationDisallowsLeadingSlashInClasspathLocation() {
    Environment environment = new ImmutableEnvironment("/otherApplicationConfigs");

    assertThatThrownBy(() -> source.getConfiguration(environment)).isExactlyInstanceOf(MissingEnvironmentException.class);
  }

  @Test
  void getConfigurationReadsFromGivenFiles() {
    configFilesProvider = () -> Arrays.asList(
        Paths.get("application.properties"),
        Paths.get("otherConfig.properties")
    );

    source = new ClasspathConfigurationSource(configFilesProvider);
    assertThat(source.getConfiguration(new DefaultEnvironment())).containsOnlyKeys("some.setting", "otherConfig.setting");
  }

  @Test
  void getConfigurationThrowsOnMissingEnvironment() {
    assertThatThrownBy(() -> source.getConfiguration(new ImmutableEnvironment("awlerijawoetinawwerlkjn"))).isExactlyInstanceOf(MissingEnvironmentException.class);
  }

  @Test
  void getConfigurationThrowsOnMissingConfigFile() {
    configFilesProvider = () -> Collections.singletonList(