### Question:
AlleleRegionCalculator extends AbstractAlleleCalculator { @Override public void addVariant(Variant variant) { PositionInfo positionInfo = buildPositionInfo(variant); positionInfo.getSampleAlleleRegionInfos().forEach((k, v) -> this.store.addAll(v)); } AlleleRegionCalculator(String studyId, Map<String, Integer> sampleNameToSampleId, int start, int endInclusive);  AlleleRegionCalculator(String studyId, Map<String, Integer> sampleNameToSampleId, AlleleRegionStore store); AlleleRegionStore getStore(); @Override void addVariant(Variant variant); @Override Map<Integer, Map<String, AlleleCountPosition>> buildVariantMap(); Map<Integer, Map<String, AlleleCountPosition>> buildVariantMap(Region target); @Override Map<Integer, AlleleCountPosition> buildReferenceMap(); Map<Integer, AlleleCountPosition> buildReferenceMap(Region target); @Override Set<Integer> getPass(Integer position); @Override Set<Integer> getNotPass(Integer position); @Override void onlyLeaveSparseRepresentation(int startPos, int nextStartPos, boolean removePass, boolean
            removeHomRef); @Override void fillNoCalls(Collection<String> expectedSamples, long startPos, long nextStartPos); @Override AlleleCountPosition buildVariantCount(Integer position, String variant); @Override AlleleCountPosition buildPositionCount(Integer position);  }### Answer:
@Test public void addVariant() throws Exception { AlleleRegionCalculator calculator = new AlleleRegionCalculator("1", snToSid, 10, 20); calculator.addVariant(varA); calculator.addVariant(varB); AlleleRegionStore store = calculator.getStore(); List<Region<AlleleInfo>> reglst = store.getVariation(new RegionImpl(null, 10,20)); assertEquals(1, reglst.size()); Region<AlleleInfo> areg = reglst.get(0); assertEquals(varA.getStart().intValue(), areg.getStart()); AlleleInfo ai = areg.getData(); assertEquals(varA.getReference(), ai.getId()[0]); assertEquals(varA.getAlternate(), ai.getId()[1]); assertEquals(1, ai.getSampleIds().size()); assertEquals(2, store.getReference(new PointRegion(0, 13)).size()); assertEquals(1, store.getAll(new PointRegion(0, 12)).size()); assertEquals(3, store.getAll(new PointRegion(0, 13)).size()); calculator.addVariant(varC); calculator.addVariant(varD); assertEquals(3,store.getVariation(new RegionImpl(null, 10,20)).size()); assertEquals(3,store.getVariation(new PointRegion(null, 13)).size()); assertEquals(4, store.getReference(new PointRegion(0, 13)).size()); calculator.addVariant(varC2); assertEquals(4,store.getVariation(new PointRegion(null, 13)).size()); }