### Question:
SampleVariantStatsCalculator implements Task<Variant, Variant> { public List<SampleVariantStats> compute(List<Variant> variants) { return compute(variants.iterator()); } SampleVariantStatsCalculator(VariantStudyMetadata studyMetadata);  SampleVariantStatsCalculator(Pedigree pedigree, List<String> samples);  SampleVariantStatsCalculator(Pedigree pedigree, List<String> samples, Map<String, String> sampleFileMap); List<SampleVariantStats> getSampleVariantStats(); @Override synchronized List<Variant> apply(List<Variant> batch); @Override void pre(); List<SampleVariantStats> compute(List<Variant> variants); List<SampleVariantStats> compute(Iterator<Variant> variantIterator); void update(Variant variant); void update(Variant variant, VariantAnnotation annotation, List<String> gts, List<String> dps, List<String> quals, List<String> filters); void update(Variant variant, List<String> gts, List<String> dps, List<String> quals, List<String> filters, Set<String> cts,
                       Set<String> biotypes, Set<String> clinicalSignificance); static SampleVariantStats merge(SampleVariantStats stats, SampleVariantStats otherStats); @Override void post();  }### Answer:
@Test public void testFromPedigree() { SampleVariantStatsCalculator calculator = new SampleVariantStatsCalculator(pedigree, samples); List<SampleVariantStats> sampleStats = calculator.compute(variants); checkStats(sampleStats); }
@Test public void testFromMetadata() { VariantMetadataManager metadataManager = new VariantMetadataManager(); metadataManager.addVariantStudyMetadata("study"); metadataManager.addFile("file", new VCFHeader(new HashSet<>(), samples), "study"); VariantMetadata metadata = metadataManager.loadPedigree(pedigree, "study"); SampleVariantStatsCalculator calculator = new SampleVariantStatsCalculator(metadata.getStudies().get(0)); List<SampleVariantStats> sampleStats = calculator.compute(variants); checkStats(sampleStats); }