YamlConfiguration extends FileConfiguration { public static YamlConfiguration loadConfiguration(final File file) { Validate.notNull(file, "File cannot be null"); return YamlConfiguration.load(config -> config.load(file)); }  static YamlConfiguration loadConfiguration(final File file); static YamlConfiguration loadConfiguration(final InputStream stream); static YamlConfiguration loadConfiguration(final Reader reader); @Override String saveToString(); @Override void loadFromString(final String contents); @Override YamlConfigurationOptions options();  }
@Test void loadConfiguration() { final InputStreamOf stream = new InputStreamOf( new ResourceOf("test.yml")); final YamlConfiguration configuration = YamlConfiguration.loadConfiguration(stream); MatcherAssert.assertThat( "Couldn't load the input stream!", configuration.getInt("test.number"), new IsEqual<>(5) ); MatcherAssert.assertThat( "Couldn't load the input stream!", configuration.getString("test.string"), new IsEqual<>("Hello world") ); MatcherAssert.assertThat( "Couldn't load the input stream!", configuration.getBoolean("test.boolean"), new IsEqual<>(true) ); MatcherAssert.assertThat( "Couldn't load the input stream!", configuration.getStringList("test.list"), new HasValues<>( "Each", "word", "will", "be", "in", "a", "separated", "entry" ) ); }