FileConfiguration extends MemoryConfiguration { public abstract void loadFromString(String contents) throws InvalidConfigurationException; FileConfiguration();  FileConfiguration(Configuration defaults); void save(File file); void save(String file); abstract String saveToString(); void load(File file); @Deprecated void load(InputStream stream); void load(Reader reader); void load(String file); abstract void loadFromString(String contents); @Override FileConfigurationOptions options();  }
@Test public void testLoadFromString() throws Exception { FileConfiguration config = getConfig(); Map<String, Object> values = getTestValues(); String saved = getTestValuesString(); config.loadFromString(saved); for (Map.Entry<String, Object> entry : values.entrySet()) { assertEquals(entry.getValue(), config.get(entry.getKey())); } assertEquals(values.keySet(), config.getKeys(true)); assertEquals(saved, config.saveToString()); }