class ConfigWriter {

    public void write(ConfigNode writing) throws IOException {
        Verify.nullCheck(outputPath, () -> new IllegalStateException("Output path was null."));

        ConfigNode storedParent = writing.parent;
        writing.updateParent(null);

        Path directory = outputPath.getParent();
        if (!directory.toRealPath().toFile().isDirectory()) {
            Files.createDirectories(directory);
        }
        Files.write(outputPath, createLines(writing), StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE);

        writing.updateParent(storedParent);
    }

    public  ConfigWriter();
    public  ConfigWriter(Path outputPath);

}