@Test
public void testWriteContributingVariantsOnlyStringIsEmptyForIncompatibleMode() {

    OutputSettings settings = settingsBuilder.outputContributingVariantsOnly(true).build();
    Gene fgfr2 = TestFactory.newGeneFGFR2();
    fgfr2.setCompatibleInheritanceModes(EnumSet.of(ModeOfInheritance.AUTOSOMAL_DOMINANT));
    VariantEvaluation passVariant = makePassVariant();
    passVariant.setCompatibleInheritanceModes(EnumSet.of(ModeOfInheritance.AUTOSOMAL_DOMINANT));
    fgfr2.addVariant(passVariant);
    VariantEvaluation contributingVariant = makeContributingVariant();
    contributingVariant.setCompatibleInheritanceModes(EnumSet.of(ModeOfInheritance.AUTOSOMAL_DOMINANT));
    contributingVariant.setContributesToGeneScoreUnderMode(ModeOfInheritance.AUTOSOMAL_DOMINANT);
    GeneScore geneScore = GeneScore.builder()
            .modeOfInheritance(ModeOfInheritance.AUTOSOMAL_DOMINANT)
            .geneIdentifier(fgfr2.getGeneIdentifier())
            .contributingVariants(ImmutableList.of(contributingVariant))
            .build();
    fgfr2.addVariant(contributingVariant);
    fgfr2.addGeneScore(geneScore);
    AnalysisResults results = AnalysisResults.builder()
            .genes(Collections.singletonList(fgfr2))
            .build();
    String outString = instance.writeString(ModeOfInheritance.AUTOSOMAL_RECESSIVE, analysis, results, settings);
    String expected = HEADER;
    assertThat(outString, equalTo(expected));
}