### Question:
ProbabilitiesConvertor { public static double[][][] convertCalledAllelesToPhasedProbabilities(List<Alleles> sampleAlleles, Alleles alleles) { double[][][] probs = new double[sampleAlleles.size()][][]; if (alleles.getAlleleCount() == 0) { throw new GenotypeDataException("Error converting alleles to probabilities. No alleles detected"); } for (int sampleIndex = 0; sampleIndex < sampleAlleles.size(); sampleIndex++) { Alleles allelesForSample = sampleAlleles.get(sampleIndex); int ploidy = allelesForSample.getAlleleCount(); double[][] sampleProbabilities = new double[ploidy][alleles.getAlleleCount()]; for (int i = 0; i < ploidy; i++) { Allele allele = allelesForSample.get(i); int indexOfSampleAllele = alleles.getAlleles().indexOf(allele); if (indexOfSampleAllele != -1) { sampleProbabilities[i][indexOfSampleAllele] = 1; } } probs[sampleIndex] = sampleProbabilities; } return probs; }  static float[][] convertCalledAllelesToProbability(List<Alleles> sampleAlleles, Alleles alleles); static float[][] convertDosageToProbabilityHeuristic(float[] sampleDosages); static List<Alleles> convertProbabilitiesToAlleles(float[][] probs, Alleles variantAlleles, double minProbability); static float[] convertProbabilitiesToDosage(float[][] probs, double minProbability); static float[][] convertBiallelicComplexProbabilitiesToProbabilities(double[][] complexProbabilities); static double[][] convertProbabilitiesToComplexProbabilities(float[][] probabilities); static double[][] convertPhasedProbabilitiesToComplexProbabilities(double[][][] haplotypeProbabilities); static double[][][] haplotypeDosagesToHaplotypeProbabilities(double[][] haplotypeDosages); static double[][][] convertCalledAllelesToPhasedProbabilities(List<Alleles> sampleAlleles, Alleles alleles); static double[][] convertCalledAllelesToComplexProbabilities(
    		List<Alleles> allelesPerSample, Alleles variantAlleles);  }### Answer:
@Test public void testCalledAllelesToPhasedProbabilities() { System.out.println("convertCalledAllelesToPhasedProbabilities"); double[][][] expectedProbs = new double[4][][]; expectedProbs[0] = new double[][]{{0, 1},{0, 1}}; expectedProbs[1] = new double[][]{{1, 0},{1, 0}}; expectedProbs[2] = new double[][]{{1, 0},{0, 1}}; expectedProbs[3] = new double[][]{{0, 1},{1, 0}}; List<Alleles> sampleAlleles = Arrays.asList( Alleles.createAlleles(Allele.G, Allele.G), Alleles.createAlleles(Allele.A, Allele.A), Alleles.createAlleles(Allele.A, Allele.G), Alleles.createAlleles(Allele.G, Allele.A)); Alleles alleles = Alleles.createAlleles(Allele.A, Allele.G); double[][][] actualProbs = ProbabilitiesConvertor .convertCalledAllelesToPhasedProbabilities( sampleAlleles, alleles); assertEquals(actualProbs, expectedProbs); }