code: @Override
    public Properties getConfiguration(Environment environment) {
      Properties properties = new Properties();
  
      Path pathPrefix = Paths.get(environment.getName());
  
      URL url = getClass().getClassLoader().getResource(pathPrefix.toString());
      if (url == null && !environment.getName().isEmpty()) {
        throw new MissingEnvironmentException("Directory doesn't exist: " + environment.getName());
      }
  
      List<Path> paths = new ArrayList<>();
      for (Path path : configFilesProvider.getConfigFiles()) {
        paths.add(pathPrefix.resolve(path));
      }
  
      for (Path path : paths) {
        try (InputStream input = getClass().getClassLoader().getResourceAsStream(path.toString())) {
  
          if (input == null) {
            throw new IllegalStateException("Unable to load properties from classpath: " + path);
          }
  
          PropertiesProvider provider = propertiesProviderSelector.getProvider(path.getFileName().toString());
          properties.putAll(provider.getProperties(input));
  
        } catch (IOException e) {
          throw new IllegalStateException("Unable to load properties from classpath: " + path, e);
        }
      }
  
      return properties;
    }
docs: Get configuration from classpath. See the class-level javadoc for detail on environment resolution.
  
  @param environment environment to fetch configuration for
  @return configuration set for {@code environment}
  @throws MissingEnvironmentException when requested environment couldn't be found
  @throws IllegalStateException       when unable to fetch configuration