### Question:
VariantAlternateRearranger { public Genotype rearrangeGenotype(String genotypeString, String reference, List<String> alternateAlleles) { return rearrangeGenotype(new Genotype(genotypeString, reference, alternateAlleles)); } <T> VariantAlternateRearranger(List<T> originalAlternates, List<T> reorderedAlternates); <T> VariantAlternateRearranger(List<T> originalAlternates, List<T> reorderedAlternates,
                                          Configuration configuration); Genotype rearrangeGenotype(String genotypeString, String reference, List<String> alternateAlleles); Genotype rearrangeGenotype(Genotype genotype); String rearrangeNumberR(String data); String rearrangeNumberR(String data, String missingValue); List<T> rearrangeNumberR(List<T> values, T missingValue); String rearrangeNumberA(String data); String rearrangeNumberA(String data, String missingValue); List<T> rearrangeNumberA(List<T> values, T missingValue); String rearrangeNumberG(String data, String missingValue, @Nullable Integer ploidy); List<T> rearrangeNumberG(List<T> values, T missingValue, @Nullable Integer ploidy); static List<String> getOrdering(int p, int n, int[] map); static void getOrdering(int p, int n, List<String> list, int[] gt, int pos, int[] map); String rearrange(String key, String data); String rearrange(String key, String data, @Nullable Integer ploidy); static final int DEFAULT_PLOIDY; }### Answer:
@Test public void testRearrangeGenotype() { VariantAlternateRearranger r = new VariantAlternateRearranger(Arrays.asList("A", "B"), Arrays.asList("B", "A", "C")); assertEquals("2/1", r.rearrangeGenotype(new Genotype("1/2")).toString()); assertEquals("./.", r.rearrangeGenotype(new Genotype("./.")).toString()); assertEquals("./2", r.rearrangeGenotype(new Genotype("./1")).toString()); }
@Test public void testRearrangeGenotype_missingAlternates() { VariantAlternateRearranger r = new VariantAlternateRearranger(Arrays.asList("A", "T"), Arrays.asList("C", "A")); assertEquals("2/.", r.rearrangeGenotype(new Genotype("1/2")).toString()); assertEquals("./.", r.rearrangeGenotype(new Genotype("./.")).toString()); assertEquals("./2", r.rearrangeGenotype(new Genotype("./1")).toString()); }