code: public long finish() {
      final BAMIndexContent content = indexBuilder.processReference(referenceIndex);
      outputWriter.writeReference(content);
      outputWriter.close();
      return indexBuilder.getNoCoordinateRecordCount();
    }
docs: Finalizes writing and closes the file.
  @return count of records with no coordinates.