ConfigWriter { public File save() { ConfigRenderOptions renderOptions = ConfigRenderOptions.defaults() .setComments(true) .setFormatted(true) .setOriginComments(false) .setJson(false); bumpVersion(); String configData = configImpl.root().render(renderOptions); FileWriter writer = null; try { writer = new FileWriter(tmpFile.toFile()); writer.write(configData); } catch (IOException e) { logger.warn("failed to write file, message={}", e.getMessage()); } finally { CloseableUtils.closeQuietly(writer); } return tmpFile.toFile(); } ConfigWriter(File configFile); File save(); void setBucketMap(String shardId, String bucketMapString);  }
@Test public void testSave() throws Exception { configWriter.setBucketMap("shard1", "1-1000"); configWriter.save(); }