public <T> void load(@Nonnull Path path, T object) {
        try {
            L loader = loader(path);
            ObjectMapper<T>.BoundInstance mapper = objectMapper(object);

            if (!Files.exists(path)) {
                // create a new empty node
                N node = loader.createEmptyNode();
                // write the content of the object to the node
                mapper.serialize(node);
                // save the node
                loader.save(node);
            } else {
                // load the node from the file
                N node = loader.load();
                // populate the config object
                mapper.populate(node);
            }
        } catch (ObjectMappingException | IOException e) {
            throw new ConfigurationException(e);
        }
    }
Misc utilities for working with Configurate
helper/src/main/java/me/lucko/helper/config/ConfigFactory.java