KnownVariantFilter implements VariantFilter { @Override public FilterResult runFilter(VariantEvaluation variantEvaluation) { if (notRepresentedInDatabase(variantEvaluation)) { return PASS; } return FAIL; }  @Override FilterResult runFilter(VariantEvaluation variantEvaluation); @Override FilterType getFilterType(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testRunFilterReturnsFailResultWhenFilteringVariantWithRsId() { FrequencyData frequencyData = FrequencyData.of(RsId.of(12345)); VariantEvaluation variantEvaluation = buildVariantWithFrequencyData(frequencyData); FilterResult filterResult = instance.runFilter(variantEvaluation); assertThat(filterResult, equalTo(FAIL_RESULT)); }
@Test public void testRunFilterReturnsFailResultWhenFilteringVariantWithKnownFrequency() { FrequencyData frequencyData = FrequencyData.of(RsId.empty(), Frequency.of(FrequencySource.THOUSAND_GENOMES, 1f)); VariantEvaluation variantEvaluation = buildVariantWithFrequencyData(frequencyData); FilterResult filterResult = instance.runFilter(variantEvaluation); assertThat(filterResult, equalTo(FAIL_RESULT)); }
@Test public void testRunFilterReturnsPassResultWhenFilteringVariantWithNoRepresentationInDatabase() { VariantEvaluation variantEvaluation = buildVariantWithFrequencyData(FrequencyData.empty()); FilterResult filterResult = instance.runFilter(variantEvaluation); assertThat(filterResult, equalTo(PASS_RESULT)); }