### Question:
PedMapGenotypeData extends AbstractRandomAccessGenotypeData implements SampleVariantsProvider { @Override public List<Alleles> getSampleVariants(GeneticVariant variant) { if (variant.getPrimaryVariantId() == null) { throw new IllegalArgumentException("Not a snp, missing primaryVariantId"); } int index = snpIndexById.get(variant.getPrimaryVariantId()); if (index == -1) { throw new IllegalArgumentException("Unknown primaryVariantId [" + variant.getPrimaryVariantId() + "]"); } List<Alleles> bialleles = sampleAllelesBySnpIndex.get(index); return Collections.unmodifiableList(bialleles); } PedMapGenotypeData(String basePath);  PedMapGenotypeData(File pedFile, File mapFile); @Override List<Sequence> getSequences(); @Override List<Sample> getSamples(); @Override List<Alleles> getSampleVariants(GeneticVariant variant); @Override Map<String, Annotation> getVariantAnnotationsMap(); @Override List<String> getSeqNames(); @Override Iterable<GeneticVariant> getVariantsByPos(String seqName, int startPos); @Override Iterator<GeneticVariant> iterator(); @Override Iterable<GeneticVariant> getSequenceGeneticVariants(String seqName); @Override int cacheSize(); @Override List<Boolean> getSamplePhasing(GeneticVariant variant); @Override boolean arePhasedProbabilitiesPresent(GeneticVariant variant); @Override int getSampleVariantProviderUniqueId(); @Override Map<String, SampleAnnotation> getSampleAnnotationsMap(); @Override Iterable<GeneticVariant> getVariantsByRange(String seqName, int rangeStart, int rangeEnd); @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);  }### Answer:
@Test public void testGetSnpVariantByPos() { int pos = 14433624; GeneticVariant variant = genotypeData.getSnpVariantByPos("22", pos); assertNotNull(variant); assertEquals(variant.getStartPos(), pos); ArrayList<Alleles> expectedSampleAlleles = new ArrayList<Alleles>(9); expectedSampleAlleles.add(Alleles.createBasedOnChars('G', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('A', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('G', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('G', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('G', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('A', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('G', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('G', 'G')); expectedSampleAlleles.add(Alleles.createBasedOnChars('A', 'G')); assertEquals(variant.getSampleVariants(), expectedSampleAlleles); assertEquals(variant.getVariantAlleles(), Alleles.createBasedOnChars('G', 'A')); byte[] expectedCalledDosage = new byte[] { 2, 1, 2, 2, 2, 1, 2, 2, 1 }; assertEquals(variant.getSampleCalledDosages(), expectedCalledDosage); }