@Nonnull
        @Override
        public GsonConfigurationLoader loader(@Nonnull Path path) {
            GsonConfigurationLoader.Builder builder = GsonConfigurationLoader.builder()
                    .setIndent(2)
                    .setSource(() -> Files.newBufferedReader(path, StandardCharsets.UTF_8))
                    .setSink(() -> Files.newBufferedWriter(path, StandardCharsets.UTF_8));

            builder.setDefaultOptions(builder.getDefaultOptions().withSerializers(TYPE_SERIALIZERS));
            return builder.build();
        }
Misc utilities for working with Configurate
helper/src/main/java/me/lucko/helper/config/ConfigFactory.java