FileConfiguration extends MemoryConfiguration { public abstract String saveToString(); 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 testSaveToString() { FileConfiguration config = getConfig(); for (Map.Entry<String, Object> entry : getTestValues().entrySet()) { config.set(entry.getKey(), entry.getValue()); } String result = config.saveToString(); String expected = getTestValuesString(); assertEquals(expected, result); }