@Test
public void assignsRegulatoryVariantToBestPhenotypicMatchVariantNotOriginallyAssociatedWithBestCandidateGeneHasMatchingAnnotationsTransferred() {

    addPriorityResultWithScore(gene1, 1d);
    addPriorityResultWithScore(gene2, 0d);
    TopologicalDomain tad = makeTad(1, 1, 20000, gene1, gene2);
    instance = makeInstance(PriorityType.HIPHIVE_PRIORITY, tad);
    VariantEvaluation variant = regulatoryVariantInTad(tad, gene2);
    TranscriptAnnotation gene2Annotation = TranscriptAnnotation.builder().geneSymbol(gene2.getGeneSymbol()).build();
    TranscriptAnnotation gene1Annotation = TranscriptAnnotation.builder().geneSymbol(gene1.getGeneSymbol()).build();
    variant.setAnnotations(Arrays.asList(gene2Annotation, gene1Annotation));
    instance.reassignRegulatoryRegionVariantToMostPhenotypicallySimilarGeneInTad(variant);
    assertThat(variant, isAssignedTo(gene1));
    assertThat(variant.getTranscriptAnnotations(), equalTo(Collections.singletonList(gene1Annotation)));
}