### Question:
CachedSampleVariantProvider implements SampleVariantsProvider { @Override public FixedSizeIterable<GenotypeRecord> getSampleGenotypeRecords(GeneticVariant variant) { if (genotypeRecordCache.containsKey(variant)) { return genotypeRecordCache.get(variant); } FixedSizeIterable<GenotypeRecord> sampleGenotypeRecords = sampleVariantProvider.getSampleGenotypeRecords(variant); genotypeRecordCache.put(variant, sampleGenotypeRecords); return sampleGenotypeRecords; } CachedSampleVariantProvider(SampleVariantsProvider sampleVariantProvider, int cacheSize); @Override List<Alleles> getSampleVariants(GeneticVariant variant); @Override int cacheSize(); @Override List<Boolean> getSamplePhasing(GeneticVariant variant); @Override boolean arePhasedProbabilitiesPresent(GeneticVariant variant); @Override int getSampleVariantProviderUniqueId(); @Override byte[] getSampleCalledDosage(GeneticVariant variant); @Override float[] getSampleDosage(GeneticVariant variant); @Override float[][] getSampleProbilities(GeneticVariant variant); @Override double[][] getSampleProbabilitiesComplex(GeneticVariant variant); @Override double[][][] getSampleProbabilitiesPhased(GeneticVariant variant); @Override FixedSizeIterable<GenotypeRecord> getSampleGenotypeRecords(GeneticVariant variant);  }### Answer:
@Test public void getSampleGenotypeRecords() { SampleVariantsProvider sampleVariantProvider = mock(SampleVariantsProvider.class); CachedSampleVariantProvider cachedSampleVariantProvider = new CachedSampleVariantProvider(sampleVariantProvider , 1); GeneticVariant variant = mock(GeneticVariant.class); cachedSampleVariantProvider.getSampleGenotypeRecords(variant); cachedSampleVariantProvider.getSampleGenotypeRecords(variant); verify(sampleVariantProvider, times(1)).getSampleGenotypeRecords(variant); }