docs: public static void writeObjectToFile(String path, Object toWrite, Configuration hadoopConfig) throws IOException {
          FileSystem fileSystem = FileSystem.get(hadoopConfig);
          try (BufferedOutputStream bos = new BufferedOutputStream(fileSystem.create(new Path(path)))) {
              ObjectOutputStream oos = new ObjectOutputStream(bos);
              oos.writeObject(toWrite);
          }
      }