RecoveredVariantFactory implements AutoCloseable { @VisibleForTesting static boolean isAppropriatelyFiltered(@NotNull VariantContext variantContext) { final Set<String> filters = variantContext.getFilters(); return !filters.isEmpty() && filters.stream().noneMatch(DO_NOT_RESCUE::contains); } RecoveredVariantFactory(@NotNull final PurityAdjuster purityAdjuster, @NotNull final String recoveryVCF); @Override void close();  }
@Test public void testFilterFilter() { final String eligible = "16 33040204 gridss81_16816h G ]16:33040203]GGCGGCGGGGCAA 343.95 BPI.Filter.SRSupportZero;someFilter SVTYPE=BND GT\t./."; final String passing = "16 33040204 gridss81_16816h G ]16:33040203]GGCGGCGGGGCAA 343.95 . SVTYPE=BND GT\t./."; final String ponFiltered = "16 33040203 gridss81_16816o G GGTAAGAATCCGC[16:33040204[ 343.95 PON SVTYPE=BND GT\t./."; assertTrue(RecoveredVariantFactory.isAppropriatelyFiltered(codec.decode(eligible))); assertFalse(RecoveredVariantFactory.isAppropriatelyFiltered(codec.decode(passing))); assertTrue(RecoveredVariantFactory.isAppropriatelyFiltered(codec.decode(ponFiltered))); for (String filter : RecoveredVariantFactory.DO_NOT_RESCUE) { final String ineligible = ponFiltered.replace("PON", filter); assertFalse(RecoveredVariantFactory.isAppropriatelyFiltered(codec.decode(ineligible))); } }