@Test
public void testUpstreamGeneIntergenicVariantsInRegulatoryRegion() {

    //Without the regulatory regions in the annotator
    VariantAnnotation upstreamVariant = instance.annotate("10", 123357973, "T", "G");
    assertThat(upstreamVariant.getVariantEffect(), equalTo(VariantEffect.UPSTREAM_GENE_VARIANT));
    VariantAnnotation intergenicVariant = instance.annotate("10", 150000000, "T", "G");
    assertThat(intergenicVariant.getVariantEffect(), equalTo(VariantEffect.INTERGENIC_VARIANT));
    //Regulatory regions containing the variants
    RegulatoryFeature enhancer = new RegulatoryFeature(10, upstreamVariant.getPosition(), upstreamVariant.getPosition(), RegulatoryFeature.FeatureType.ENHANCER);
    RegulatoryFeature tfBindingSite = new RegulatoryFeature(10, intergenicVariant.getPosition(), intergenicVariant.getPosition(), RegulatoryFeature.FeatureType.TF_BINDING_SITE);
    //Create new annotator with the regulatory regions
    VariantAnnotator annotatorWithRegulatoryRegions = new JannovarVariantAnnotator(TestFactory.getDefaultGenomeAssembly(),
            TestFactory.buildDefaultJannovarData(),
            ChromosomalRegionIndex.of(ImmutableList.of(enhancer, tfBindingSite))
    );
    //Annotate the original positions using the new annotator...
    VariantAnnotation wasUpstream = annotatorWithRegulatoryRegions.annotate(upstreamVariant.getChromosomeName(), upstreamVariant.getPosition(), upstreamVariant.getRef(), upstreamVariant.getAlt());
    assertThat(wasUpstream.getVariantEffect(), equalTo(VariantEffect.REGULATORY_REGION_VARIANT));
    //... and lo! They are designated as regulatory region variants!
    VariantAnnotation wasIntergenic = annotatorWithRegulatoryRegions.annotate(intergenicVariant.getChromosomeName(), intergenicVariant.getPosition(), intergenicVariant.getRef(), intergenicVariant.getAlt());
    assertThat(wasIntergenic.getVariantEffect(), equalTo(VariantEffect.REGULATORY_REGION_VARIANT));
}