### Question:
VcfGenotypeData extends AbstractRandomAccessGenotypeData implements SampleVariantsProvider { @Override public Iterable<GeneticVariant> getVariantsByPos(final String seqName, final int startPos) { return getVariantsByRange(seqName, startPos - 1, startPos); } 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 testGeneticVariantAnnotations() { List<GeneticVariant> variants = Lists.newArrayList(genotypeData.getVariantsByPos("1", 3171929)); assertNotNull(variants); assertEquals(variants.size(), 1); GeneticVariant variant = variants.get(0); assertNotNull(variant.getAnnotationValues()); assertEquals(variant.getAnnotationValues().size(), 9); Object annotationValue = variant.getAnnotationValues().get("NS"); assertNotNull(annotationValue); assertEquals(annotationValue, Integer.valueOf(1)); annotationValue = variant.getAnnotationValues().get("AF"); assertNotNull(annotationValue); assertTrue(annotationValue instanceof List); @SuppressWarnings("unchecked") List<Float> floats = (List<Float>) annotationValue; assertEquals(floats.size(), 1); assertEquals(floats.get(0).floatValue(), 1.0, 0.001); annotationValue = variant.getAnnotationValues().get("ANNOT"); assertNotNull(annotationValue); assertTrue(annotationValue instanceof List); @SuppressWarnings("unchecked") List<String> strings = (List<String>) annotationValue; assertEquals(strings.size(), 1); assertEquals(strings.get(0), "INT"); assertEquals(variant.getAnnotationValues().get("VCF_Filter"), "flt"); assertNull(variant.getAnnotationValues().get("VCF_Qual")); }
@Test public void testStopPos() throws IOException, URISyntaxException { List<GeneticVariant> variants = Lists.newArrayList(genotypeData.getVariantsByPos("1", 565286)); assertNotNull(variants); assertEquals(variants.size(), 1); variants = Lists.newArrayList(genotypeData.getVariantsByPos("3", 7569)); assertNotNull(variants); assertEquals(variants.size(), 1); }