### Question:
VcfGenotypeData extends AbstractRandomAccessGenotypeData implements SampleVariantsProvider { @Override public Map<String, Annotation> getVariantAnnotationsMap() { if (cachedSampleAnnotationsMap == null) { cachedSampleAnnotationsMap = new LinkedHashMap<String, Annotation>(); for (VcfMetaInfo info : vcfMeta.getInfoMeta()) { cachedSampleAnnotationsMap.put(info.getId(), VcfAnnotation.fromVcfInfo(info)); } } return cachedSampleAnnotationsMap; } VcfGenotypeData(File bzipVcfFile, int cacheSize, double minimumPosteriorProbabilityToCall);  VcfGenotypeData(File bzipVcfFile, File tabixIndexFile, double minimumPosteriorProbabilityToCall);  VcfGenotypeData(File bzipVcfFile, File tabixIndexFile, int cacheSize, double minimumPosteriorProbabilityToCall); @Override Iterator<GeneticVariant> iterator(); @Override List<Alleles> getSampleVariants(final GeneticVariant variant); @Override Map<String, Annotation> getVariantAnnotationsMap(); @Override List<Sequence> getSequences(); @Override List<Sample> getSamples(); @Override int cacheSize(); @Override List<Boolean> getSamplePhasing(GeneticVariant variant); @Override boolean arePhasedProbabilitiesPresent(GeneticVariant variant); @Override int getSampleVariantProviderUniqueId(); @Override Map<String, SampleAnnotation> getSampleAnnotationsMap(); @Override byte[] getSampleCalledDosage(GeneticVariant variant); @Override float[] getSampleDosage(GeneticVariant variant); @Override void close(); @Override boolean isOnlyContaingSaveProbabilityGenotypes(); @Override float[][] getSampleProbilities(GeneticVariant variant); @Override double[][] getSampleProbabilitiesComplex(GeneticVariant variant); @Override double[][][] getSampleProbabilitiesPhased(GeneticVariant variant); @Override FixedSizeIterable<GenotypeRecord> getSampleGenotypeRecords(GeneticVariant variant); @Override List<String> getSeqNames(); @Override Iterable<GeneticVariant> getSequenceGeneticVariants(String seqName); @Override Iterable<GeneticVariant> getVariantsByPos(final String seqName, final int startPos); @Override GeneticVariant getSnpVariantByPos(String seqName, int startPos); @Override Iterable<GeneticVariant> getVariantsByRange(final String seqName, final int rangeStart, final int rangeEnd); MappedGenotypeField getPreferredGenotypeField(); void setPreferredGenotypeField(String preferredGenotypeField);  }### Answer:
@Test public void getVariantAnnotationsMap() { Map<String, Annotation> annotations = genotypeData.getVariantAnnotationsMap(); assertNotNull(annotations); assertEquals(annotations.size(), 21); Annotation annotation = annotations.get("NS"); assertNotNull(annotation); assertEquals(annotation.getId(), "NS"); assertTrue(annotation instanceof VcfAnnotation); }