### Question:
VcfSliceToVariantListConverter implements Converter<VcfSliceProtos.VcfSlice, List<Variant>> { @Override public List<Variant> convert(VcfSliceProtos.VcfSlice vcfSlice) { return convert(vcfSlice, null); } VcfSliceToVariantListConverter(VariantStudyMetadata metadata);  VcfSliceToVariantListConverter(Map<String, Integer> samplesPosition, String fileId, String studyId); @Override List<Variant> convert(VcfSliceProtos.VcfSlice vcfSlice); List<Variant> convert(VcfSliceProtos.VcfSlice vcfSlice, Predicate<VcfSliceProtos.VcfRecord> filter);  }### Answer:
@Test public void testConvertVariants() throws InvalidProtocolBufferException { VariantToVcfSliceConverter converter = new VariantToVcfSliceConverter(); VcfSliceProtos.VcfSlice slice = converter.convert(variants, 1000); slice = VcfSliceProtos.VcfSlice.parseFrom(slice.toByteArray()); LinkedHashMap<String, Integer> samplesPosition = variants.get(0).getStudies().get(0).getSamplesPosition(); VcfSliceToVariantListConverter vcfSliceToVariantListConverter = new VcfSliceToVariantListConverter(samplesPosition, "", ""); List<Variant> convert = vcfSliceToVariantListConverter.convert(slice); assertEquals(VariantType.NO_VARIATION, convert.get(6).getType()); assertEquals(1000, convert.get(0).getEnd().intValue()); assertEquals(1000, convert.get(1).getEnd().intValue()); assertEquals(1100, convert.get(6).getEnd().intValue()); assertEquals("0", convert.get(3).getStudy("").getFile("").getData().get(StudyEntry.QUAL)); assertNull(convert.get(4).getStudy("").getFile("").getData().get(StudyEntry.QUAL)); assertNull(convert.get(5).getStudy("").getFile("").getData().get(StudyEntry.QUAL)); for (int i = 0; i < convert.size(); i++) { if (".".equals(variants.get(i).getStudy("").getFile("").getData().get(StudyEntry.QUAL))) { variants.get(i).getStudy("").getFile("").getData().remove(StudyEntry.QUAL); } System.out.println("Expected : " + variants.get(i).toJson()); System.out.println("Converted : " + convert.get(i).toJson()); System.out.println("Proto : " + slice.getRecords(i).toString()); assertEquals(variants.get(i), convert.get(i)); System.out.println("------------------------------"); } }