@@ -0,0 +1,1230 @@
+package org.biojava.nbio.phylo;%0A%0Aimport org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix;%0Aimport org.forester.phylogeny.Phylogeny;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0A/**%0A * Test for the evaluation of distance trees.%0A * %0A * @author Aleix Lafita%0A *%0A */%0Apublic class TestDistanceTreeEvaluator %7B%0A%0A%09@Test%0A%09public void testErrorFree() throws Exception %7B%0A%0A%09%09// Create a perfect additive distance matrix%0A%09%09BasicSymmetricalDistanceMatrix DM = new BasicSymmetricalDistanceMatrix(3);%0A%09%09%0A%09%09// dAB = 0.8, dBC = 0.4, dAC = 0.8%0A%09%09for (int i = 0; i %3C 3; i++)%7B%0A%09%09%09char id = (char) ('A' + i);%0A%09%09%09DM.setIdentifier(i, id + %22%22);%0A%09%09%09for (int j = i; j %3C 3; j++)%7B%0A%09%09%09%09if (i == j)%7B%0A%09%09%09%09%09DM.setValue(i, j, 0.0);%0A%09%09%09%09%7D%0A%09%09%09%09else if (i == 0) %7B%0A%09%09%09%09%09DM.setValue(i, j, 0.8);%0A%09%09%09%09%09DM.setValue(j, i, 0.8);%0A%09%09%09%09%7D else %7B%0A%09%09%09%09%09DM.setValue(i, j, 0.4);%0A%09%09%09%09%09DM.setValue(j, i, 0.4);%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09BasicSymmetricalDistanceMatrix cloneDM = ForesterWrapper.cloneDM(DM);%0A%09%09%0A%09%09//Calculate error free tree and get the cv%0A%09%09Phylogeny tree = TreeConstructor.distanceTree(cloneDM, TreeConstructorType.NJ);%0A%09%09double cv = DistanceTreeEvaluator.evaluate(tree, DM);%0A%0A%09%09// Assert error free%0A%09%09assertEquals(0.0, cv, 0.001);%0A%0A%09%7D%0A%7D%0A

Create a Test for the distance tree evaluation