code: public void save(Path filename, boolean pretty) throws IOException {
          if (filename == null || Files.exists(filename)) {
              throw new IOException("File path not correct, either it is null or file already exists: " + filename);
          }
  
          String text;
          if (pretty) {
              text = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(variantMetadata);
          } else {
              text = mapper.writeValueAsString(variantMetadata);
          }
  
          PrintWriter writer = new PrintWriter(new FileOutputStream(filename.toFile()));
          writer.write(text);
          writer.close();
      }
docs: Save variant metadata manager in JSON format into the given filename.
  
  @param filename      Filename where to store the metadata manager
  @param pretty        Flag to print pretty JSON
  @throws IOException  IOException