code: private static void addReferenceGenotype(Variant variant, VariantStats stats, int alleleNumber) {
          int gtSum = 0;
          for (Integer gtCounts : stats.getGenotypeCount().values()) {
              gtSum += gtCounts;
          }
          Genotype genotype = new Genotype("0/0", variant.getReference(), variant.getAlternate());
          stats.addGenotype(genotype, alleleNumber / 2 - gtSum);  // assuming diploid sample! be careful if you copy this code!
      }
docs: Infers the 0/0 genotype count, given that: sum(Heterozygous) + sum(Homozygous) + sum(Reference) = alleleNumber/2
  @param variant to retrieve the alleles to construct the genotype
  @param stats where to add the 0/0 genotype count
  @param alleleNumber total sum of alleles.