code: public static void writeRecord(final List<VcfSample> samples, final VcfRecord record, final PrintWriter writer) {
          checkNotNull(samples);
          checkNotNull(record);
          checkNotNull(writer);
  
          StringBuilder sb = new StringBuilder();
          sb.append(record.getChrom());
          sb.append("\t");
          sb.append(record.getPos());
  
          sb.append("\t");
          if (record.getId().length == 0) {
              sb.append(".");
          }
          else {
              sb.append(Joiner.on(";").join(record.getId()));
          }
  
          sb.append("\t");
          sb.append(record.getRef());
          sb.append("\t");
          sb.append(Joiner.on(",").join(record.getAlt()));
  
          sb.append("\t");
          if (Double.isNaN(record.getQual())) {
              sb.append(".");
          }
          else {
              sb.append((int) record.getQual());
          }
  
          sb.append("\t");
          sb.append(Joiner.on(";").join(record.getFilter()));
  
          sb.append("\t");
          if (record.getInfo().isEmpty()) {
              sb.append(".");
          }
          else {
              sb.append(Joiner.on(";").withKeyValueSeparator("=").join(record.getInfo().asMap()));
          }
  
          if (!samples.isEmpty()) {
              sb.append("\t");
              sb.append(Joiner.on(":").join(record.getFormat()));
              for (VcfSample sample : samples) {
                  sb.append("\t");
  
                  List<String> values = new ArrayList<String>();
                  for (String formatId : record.getFormat()) {
                      List<String> fieldValues = record.getGenotypes().get(sample.getId()).getFields().get(formatId);
                      values.add(fieldValues.isEmpty() ? "." : Joiner.on(",").join(fieldValues));
                  }
                  sb.append(Joiner.on(":").join(values));
              }
          }
          writer.println(sb.toString());
      }
docs: Write VCF record with the specified print writer.
  
  @param samples zero or more VCF samples, must not be null
  @param record VCF record, must not be null
  @param writer print writer to write VCF with, must not be null