private static void addGenotypesAndGTests() {
    //        for ( final int ploidy : Arrays.asList(2)) {
    for (final int ploidy : Arrays.asList(1, 2, 3, 4, 5)) {
      final List<List<String>> alleleCombinations =
          Arrays.asList(
              Arrays.asList("A"),
              Arrays.asList("A", "C"),
              Arrays.asList("A", "C", "G"),
              Arrays.asList("A", "C", "G", "T"));

      for (final List<String> alleles : alleleCombinations) {
        final VariantContextBuilder vcb = builder().alleles(alleles);
        final VariantContext site = vcb.make();
        final int nAlleles = site.getNAlleles();
        final Allele ref = site.getReference();

        // base genotype is ref/.../ref up to ploidy
        final List<Allele> baseGenotype = new ArrayList<Allele>(ploidy);
        for (int i = 0; i < ploidy; i++) baseGenotype.add(ref);
        final int nPLs = GenotypeLikelihoods.numLikelihoods(nAlleles, ploidy);

        // ada is 0, 1, ..., nAlleles - 1
        final List<Integer> ada = new ArrayList<Integer>(nAlleles);
        for (int i = 0; i < nAlleles - 1; i++) ada.add(i);

        // pl is 0, 1, ..., up to nPLs (complex calc of nAlleles and ploidy)
        final int[] pl = new int[nPLs];
        for (int i = 0; i < pl.length; i++) pl[i] = i;

        final GenotypeBuilder gb = new GenotypeBuilder("ADA_PL_SAMPLE");
        gb.alleles(baseGenotype);
        gb.PL(pl);
        gb.attribute("ADA", nAlleles == 2 ? ada.get(0) : ada);
        vcb.genotypes(gb.make());

        add(vcb);
      }
    }
  }
  private static void addGenotypes(final VariantContext site) {
    // test ref/ref
    final Allele ref = site.getReference();
    final Allele alt1 = site.getNAlleles() > 1 ? site.getAlternateAllele(0) : null;
    final Genotype homRef = GenotypeBuilder.create("homRef", Arrays.asList(ref, ref));
    addGenotypeTests(site, homRef);

    if (alt1 != null) {
      final Genotype het = GenotypeBuilder.create("het", Arrays.asList(ref, alt1));
      final Genotype homVar = GenotypeBuilder.create("homVar", Arrays.asList(alt1, alt1));
      addGenotypeTests(site, homRef, het);
      addGenotypeTests(site, homRef, het, homVar);

      // test no GT at all
      addGenotypeTests(
          site, new GenotypeBuilder("noGT", new ArrayList<Allele>(0)).attribute("INT1", 10).make());

      final List<Allele> noCall = Arrays.asList(Allele.NO_CALL, Allele.NO_CALL);

      // ploidy
      if (ENABLE_PLOIDY_TESTS) {
        addGenotypeTests(
            site,
            GenotypeBuilder.create("dip", Arrays.asList(ref, alt1)),
            GenotypeBuilder.create("hap", Arrays.asList(ref)));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("noCall", noCall),
            GenotypeBuilder.create("dip", Arrays.asList(ref, alt1)),
            GenotypeBuilder.create("hap", Arrays.asList(ref)));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("noCall", noCall),
            GenotypeBuilder.create("noCall2", noCall),
            GenotypeBuilder.create("dip", Arrays.asList(ref, alt1)),
            GenotypeBuilder.create("hap", Arrays.asList(ref)));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("dip", Arrays.asList(ref, alt1)),
            GenotypeBuilder.create("tet", Arrays.asList(ref, alt1, alt1)));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("noCall", noCall),
            GenotypeBuilder.create("dip", Arrays.asList(ref, alt1)),
            GenotypeBuilder.create("tet", Arrays.asList(ref, alt1, alt1)));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("noCall", noCall),
            GenotypeBuilder.create("noCall2", noCall),
            GenotypeBuilder.create("dip", Arrays.asList(ref, alt1)),
            GenotypeBuilder.create("tet", Arrays.asList(ref, alt1, alt1)));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("nocall", noCall),
            GenotypeBuilder.create("dip", Arrays.asList(ref, alt1)),
            GenotypeBuilder.create("tet", Arrays.asList(ref, alt1, alt1)));
      }

      //
      //
      // TESTING PHASE
      //
      //
      final Genotype gUnphased = new GenotypeBuilder("gUnphased", Arrays.asList(ref, alt1)).make();
      final Genotype gPhased =
          new GenotypeBuilder("gPhased", Arrays.asList(ref, alt1)).phased(true).make();
      final Genotype gPhased2 =
          new GenotypeBuilder("gPhased2", Arrays.asList(alt1, alt1)).phased(true).make();
      final Genotype gPhased3 =
          new GenotypeBuilder("gPhased3", Arrays.asList(ref, ref)).phased(true).make();
      final Genotype haploidNoPhase =
          new GenotypeBuilder("haploidNoPhase", Arrays.asList(ref)).make();
      addGenotypeTests(site, gUnphased, gPhased);
      addGenotypeTests(site, gUnphased, gPhased2);
      addGenotypeTests(site, gUnphased, gPhased3);
      addGenotypeTests(site, gPhased, gPhased2);
      addGenotypeTests(site, gPhased, gPhased3);
      addGenotypeTests(site, gPhased2, gPhased3);
      addGenotypeTests(site, haploidNoPhase, gPhased);
      addGenotypeTests(site, haploidNoPhase, gPhased2);
      addGenotypeTests(site, haploidNoPhase, gPhased3);
      addGenotypeTests(site, haploidNoPhase, gPhased, gPhased2);
      addGenotypeTests(site, haploidNoPhase, gPhased, gPhased3);
      addGenotypeTests(site, haploidNoPhase, gPhased2, gPhased3);
      addGenotypeTests(site, haploidNoPhase, gPhased, gPhased2, gPhased3);

      final Genotype gUnphasedTet =
          new GenotypeBuilder("gUnphasedTet", Arrays.asList(ref, alt1, ref, alt1)).make();
      final Genotype gPhasedTet =
          new GenotypeBuilder("gPhasedTet", Arrays.asList(ref, alt1, alt1, alt1))
              .phased(true)
              .make();
      addGenotypeTests(site, gUnphasedTet, gPhasedTet);
    }

    if (ENABLE_PL_TESTS) {
      if (site.getNAlleles() == 2) {
        // testing PLs
        addGenotypeTests(
            site,
            GenotypeBuilder.create("g1", Arrays.asList(ref, ref), new double[] {0, -1, -2}),
            GenotypeBuilder.create("g2", Arrays.asList(ref, ref), new double[] {0, -2, -3}));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("g1", Arrays.asList(ref, ref), new double[] {-1, 0, -2}),
            GenotypeBuilder.create("g2", Arrays.asList(ref, ref), new double[] {0, -2, -3}));

        addGenotypeTests(
            site,
            GenotypeBuilder.create("g1", Arrays.asList(ref, ref), new double[] {-1, 0, -2}),
            GenotypeBuilder.create("g2", Arrays.asList(ref, ref), new double[] {0, -2000, -1000}));

        addGenotypeTests(
            site, // missing PLs
            GenotypeBuilder.create("g1", Arrays.asList(ref, ref), new double[] {-1, 0, -2}),
            GenotypeBuilder.create("g2", Arrays.asList(ref, ref)));
      } else if (site.getNAlleles() == 3) {
        // testing PLs
        addGenotypeTests(
            site,
            GenotypeBuilder.create(
                "g1", Arrays.asList(ref, ref), new double[] {0, -1, -2, -3, -4, -5}),
            GenotypeBuilder.create(
                "g2", Arrays.asList(ref, ref), new double[] {0, -2, -3, -4, -5, -6}));
      }
    }

    // test attributes
    addGenotypeTests(site, attr("g1", ref, "INT1", 1), attr("g2", ref, "INT1", 2));
    addGenotypeTests(site, attr("g1", ref, "INT1", 1), attr("g2", ref, "INT1"));
    addGenotypeTests(site, attr("g1", ref, "INT3", 1, 2, 3), attr("g2", ref, "INT3", 4, 5, 6));
    addGenotypeTests(site, attr("g1", ref, "INT3", 1, 2, 3), attr("g2", ref, "INT3"));

    addGenotypeTests(
        site, attr("g1", ref, "INT20", TWENTY_INTS), attr("g2", ref, "INT20", TWENTY_INTS));

    if (ENABLE_VARARRAY_TESTS) {
      addGenotypeTests(
          site,
          attr("g1", ref, "INT.VAR", 1, 2, 3),
          attr("g2", ref, "INT.VAR", 4, 5),
          attr("g3", ref, "INT.VAR", 6));
      addGenotypeTests(
          site,
          attr("g1", ref, "INT.VAR", 1, 2, 3),
          attr("g2", ref, "INT.VAR"),
          attr("g3", ref, "INT.VAR", 5));
    }

    addGenotypeTests(site, attr("g1", ref, "FLOAT1", 1.0), attr("g2", ref, "FLOAT1", 2.0));
    addGenotypeTests(site, attr("g1", ref, "FLOAT1", 1.0), attr("g2", ref, "FLOAT1"));
    addGenotypeTests(
        site, attr("g1", ref, "FLOAT3", 1.0, 2.0, 3.0), attr("g2", ref, "FLOAT3", 4.0, 5.0, 6.0));
    addGenotypeTests(site, attr("g1", ref, "FLOAT3", 1.0, 2.0, 3.0), attr("g2", ref, "FLOAT3"));

    if (ENABLE_VARIABLE_LENGTH_GENOTYPE_STRING_TESTS) {
      //
      //
      // TESTING MULTIPLE SIZED LISTS IN THE GENOTYPE FIELD
      //
      //
      addGenotypeTests(
          site,
          attr("g1", ref, "GS", Arrays.asList("S1", "S2")),
          attr("g2", ref, "GS", Arrays.asList("S3", "S4")));

      addGenotypeTests(
          site, // g1 is missing the string, and g2 is missing FLOAT1
          attr("g1", ref, "FLOAT1", 1.0),
          attr("g2", ref, "GS", Arrays.asList("S3", "S4")));

      // variable sized lists
      addGenotypeTests(
          site, attr("g1", ref, "GV", "S1"), attr("g2", ref, "GV", Arrays.asList("S3", "S4")));

      addGenotypeTests(
          site,
          attr("g1", ref, "GV", Arrays.asList("S1", "S2")),
          attr("g2", ref, "GV", Arrays.asList("S3", "S4", "S5")));

      addGenotypeTests(
          site, // missing value in varlist of string
          attr("g1", ref, "FLOAT1", 1.0),
          attr("g2", ref, "GV", Arrays.asList("S3", "S4", "S5")));
    }

    //
    //
    // TESTING GENOTYPE FILTERS
    //
    //
    addGenotypeTests(
        site,
        new GenotypeBuilder("g1-x", Arrays.asList(ref, ref)).filters("X").make(),
        new GenotypeBuilder("g2-x", Arrays.asList(ref, ref)).filters("X").make());
    addGenotypeTests(
        site,
        new GenotypeBuilder("g1-unft", Arrays.asList(ref, ref)).unfiltered().make(),
        new GenotypeBuilder("g2-x", Arrays.asList(ref, ref)).filters("X").make());
    addGenotypeTests(
        site,
        new GenotypeBuilder("g1-unft", Arrays.asList(ref, ref)).unfiltered().make(),
        new GenotypeBuilder("g2-xy", Arrays.asList(ref, ref)).filters("X", "Y").make());
    addGenotypeTests(
        site,
        new GenotypeBuilder("g1-unft", Arrays.asList(ref, ref)).unfiltered().make(),
        new GenotypeBuilder("g2-x", Arrays.asList(ref, ref)).filters("X").make(),
        new GenotypeBuilder("g3-xy", Arrays.asList(ref, ref)).filters("X", "Y").make());
  }