improving GSDI, under construction...
[jalview.git] / forester / java / src / org / forester / sdi / TestGSDI.java
1 // $Id:
2 // FORESTER -- software libraries and applications
3 // for evolutionary biology research and applications.
4 //
5 // Copyright (C) 2008-2009 Christian M. Zmasek
6 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
7 // All rights reserved
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 //
23 // Contact: phylosoft @ gmail . com
24 // WWW: www.phylosoft.org/forester
25
26 package org.forester.sdi;
27
28 import java.io.IOException;
29
30 import org.forester.archaeopteryx.Archaeopteryx;
31 import org.forester.io.parsers.nhx.NHXParser;
32 import org.forester.phylogeny.Phylogeny;
33 import org.forester.phylogeny.PhylogenyMethods;
34 import org.forester.phylogeny.data.Event;
35 import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
36 import org.forester.phylogeny.factories.PhylogenyFactory;
37
38 public final class TestGSDI {
39
40     private final static Phylogeny createPhylogeny( final String nhx ) throws IOException {
41         final Phylogeny p = ParserBasedPhylogenyFactory.getInstance().create( nhx, new NHXParser() )[ 0 ];
42         p.setRooted( true );
43         return p;
44     }
45
46     private final static Event getEvent( final Phylogeny p, final String n1, final String n2 ) {
47         return PhylogenyMethods.getInstance().obtainLCA( p.getNode( n1 ), p.getNode( n2 ) ).getNodeData().getEvent();
48     }
49
50     public static boolean test() {
51         if ( !TestGSDI.testGSDI_general() ) {
52             return false;
53         }
54         if ( !TestGSDI.testGSDI_against_binary_gene_tree() ) {
55             return false;
56         }
57         return true;
58     }
59
60     private static boolean testGSDI_against_binary_gene_tree() {
61         try {
62             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
63             final String multi_species_2_str = "(((((([&&NHX:S=1],[&&NHX:S=2]),"
64                     + "([&&NHX:S=3],[&&NHX:S=4],[&&NHX:S=5])),"
65                     + "([&&NHX:S=6],[&&NHX:S=7],[&&NHX:S=8],[&&NHX:S=9])),"
66                     + "([&&NHX:S=10],[&&NHX:S=11])),"
67                     + "([&&NHX:S=12],[&&NHX:S=13],[&&NHX:S=14])),"
68                     + "([&&NHX:S=15],([&&NHX:S=16],[&&NHX:S=17]),([&&NHX:S=18],[&&NHX:S=19],[&&NHX:S=20]),([&&NHX:S=21],[&&NHX:S=22],[&&NHX:S=23],[&&NHX:S=24])));";
69             final String gene_2_1_str = "(((((([&&NHX:S=1],[&&NHX:S=2])1_2,([&&NHX:S=3],[&&NHX:S=4])),"
70                     + "([&&NHX:S=6],[&&NHX:S=7])6_7_8_9)1_9,([&&NHX:S=10],[&&NHX:S=11])),"
71                     + "([&&NHX:S=12],[&&NHX:S=13])12_13_14)1_14,"
72                     + "([&&NHX:S=15],([&&NHX:S=21],[&&NHX:S=24])21_22_23_24)15_24);";
73             final Phylogeny multi_species_2 = factory.create( multi_species_2_str, new NHXParser() )[ 0 ];
74             final Phylogeny gene_2_1 = factory.create( gene_2_1_str, new NHXParser() )[ 0 ];
75             multi_species_2.setRooted( true );
76             gene_2_1.setRooted( true );
77             final GSDI sdi = new GSDI( gene_2_1, multi_species_2, false );
78             if ( sdi.getSpeciationOrDuplicationEventsSum() != 0 ) {
79                 return false;
80             }
81             if ( sdi.getDuplicationsSum() != 0 ) {
82                 return false;
83             }
84         }
85         catch ( final Exception e ) {
86             e.printStackTrace( System.out );
87             return false;
88         }
89         return true;
90     }
91
92     private static boolean testGSDI_general() {
93         try {
94             final PhylogenyMethods pm = PhylogenyMethods.getInstance();
95             final String s2_ = "((" + "([&&NHX:S=a1],[&&NHX:S=a2],[&&NHX:S=a3],[&&NHX:S=a4]),"
96                     + "([&&NHX:S=b1],[&&NHX:S=b2],[&&NHX:S=b3],[&&NHX:S=b4]),"
97                     + "([&&NHX:S=c1],[&&NHX:S=c2],[&&NHX:S=c3],[&&NHX:S=c4]),"
98                     + "([&&NHX:S=d1],[&&NHX:S=d2],[&&NHX:S=d3],[&&NHX:S=d4])),("
99                     + "([&&NHX:S=e1],[&&NHX:S=e2],[&&NHX:S=e3],[&&NHX:S=e4]),"
100                     + "([&&NHX:S=f1],[&&NHX:S=f2],[&&NHX:S=f3],[&&NHX:S=f4]),"
101                     + "([&&NHX:S=g1],[&&NHX:S=g2],[&&NHX:S=g3],[&&NHX:S=g4]),"
102                     + "([&&NHX:S=h1],[&&NHX:S=h2],[&&NHX:S=h3],[&&NHX:S=h4])),("
103                     + "([&&NHX:S=i1],[&&NHX:S=i2],[&&NHX:S=i3],[&&NHX:S=i4]),"
104                     + "([&&NHX:S=j1],[&&NHX:S=j2],[&&NHX:S=j3],[&&NHX:S=j4]),"
105                     + "([&&NHX:S=k1],[&&NHX:S=k2],[&&NHX:S=k3],[&&NHX:S=k4]),"
106                     + "([&&NHX:S=l1],[&&NHX:S=l2],[&&NHX:S=l3],[&&NHX:S=l4])),("
107                     + "([&&NHX:S=m1],[&&NHX:S=m2],[&&NHX:S=m3],[&&NHX:S=m4]),"
108                     + "([&&NHX:S=n1],[&&NHX:S=n2],[&&NHX:S=n3],[&&NHX:S=n4]),"
109                     + "([&&NHX:S=o1],[&&NHX:S=o2],[&&NHX:S=o3],[&&NHX:S=o4]),"
110                     + "([&&NHX:S=p1],[&&NHX:S=p2],[&&NHX:S=p3],[&&NHX:S=p4])"
111                     + "),[&&NHX:S=x],[&&NHX:S=y],[&&NHX:S=z])";
112             final Phylogeny s2 = ParserBasedPhylogenyFactory.getInstance().create( s2_, new NHXParser() )[ 0 ];
113             s2.setRooted( true );
114             final String s1_ = "((([&&NHX:S=A2],[&&NHX:S=A1]),[&&NHX:S=B],[&&NHX:S=C]),[&&NHX:S=D])";
115             final Phylogeny s1 = ParserBasedPhylogenyFactory.getInstance().create( s1_, new NHXParser() )[ 0 ];
116             s1.setRooted( true );
117             final Phylogeny g1 = TestGSDI
118                     .createPhylogeny( "((((B[&&NHX:S=B],A1[&&NHX:S=A1]),C[&&NHX:S=C]),A2[&&NHX:S=A2]),D[&&NHX:S=D])" );
119             final GSDI sdi1 = new GSDI( g1, s1, false );
120             Archaeopteryx.createApplication( g1 );
121             Archaeopteryx.createApplication( s1 );
122             if ( sdi1.getDuplicationsSum() != 1 ) {
123                 return false;
124             }
125             if ( !pm.obtainLCA( g1.getNode( "B" ), g1.getNode( "A1" ) ).getNodeData().getEvent().isSpeciation() ) {
126                 return false;
127             }
128             if ( !pm.obtainLCA( g1.getNode( "C" ), g1.getNode( "A1" ) ).getNodeData().getEvent()
129                     .isSpeciationOrDuplication() ) {
130                 return false;
131             }
132             if ( !( pm.obtainLCA( g1.getNode( "A2" ), g1.getNode( "A1" ) ).getNodeData().getEvent().isDuplication() ) ) {
133                 return false;
134             }
135             if ( !pm.obtainLCA( g1.getNode( "D" ), g1.getNode( "A1" ) ).getNodeData().getEvent().isSpeciation() ) {
136                 return false;
137             }
138             //            final Phylogeny g2 = TestGSDI
139             //                    .createPhylogeny( "((((A2[&&NHX:S=A2],A1[&&NHX:S=A1]),B[&&NHX:S=B]),C[&&NHX:S=C]),D[&&NHX:S=D])" );
140             //            final GSDI sdi2 = new GSDI( g2, s1, false );
141             //            if ( sdi2.getDuplicationsSum() != 0 ) {
142             //                return false;
143             //            }
144             //            if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "A2" ) ).getNodeData().getEvent().isSpeciation() ) {
145             //                return false;
146             //            }
147             //            if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "B" ) ).getNodeData().getEvent().isSpeciation() ) {
148             //                return false;
149             //            }
150             //            if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "C" ) ).getNodeData().getEvent()
151             //                    .isSpeciationOrDuplication() ) {
152             //                return false;
153             //            }
154             //            if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "D" ) ).getNodeData().getEvent().isSpeciation() ) {
155             //                return false;
156             //            }
157             //            final Phylogeny g3 = TestGSDI
158             //                    .createPhylogeny( "((((A2[&&NHX:S=A2],A1[&&NHX:S=A1]),C[&&NHX:S=C]),B[&&NHX:S=B]),D[&&NHX:S=D])" );
159             //            final GSDI sdi3 = new GSDI( g3, s1, false );
160             //            if ( sdi3.getDuplicationsSum() != 0 ) {
161             //                return false;
162             //            }
163             //            if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "A2" ) ).getNodeData().getEvent().isSpeciation() ) {
164             //                return false;
165             //            }
166             //            if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "C" ) ).getNodeData().getEvent().isSpeciation() ) {
167             //                return false;
168             //            }
169             //            if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "B" ) ).getNodeData().getEvent()
170             //                    .isSpeciationOrDuplication() ) {
171             //                return false;
172             //            }
173             //            if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "D" ) ).getNodeData().getEvent().isSpeciation() ) {
174             //                return false;
175             //            }
176             //            final Phylogeny g4 = TestGSDI
177             //                    .createPhylogeny( "(((B[&&NHX:S=B],C1[&&NHX:S=C]),C2[&&NHX:S=C]),D[&&NHX:S=D])" );
178             //            final GSDI sdi4 = new GSDI( g4, s1, false );
179             //            if ( sdi4.getDuplicationsSum() != 1 ) {
180             //                return false;
181             //            }
182             //            if ( !pm.obtainLCA( g4.getNode( "B" ), g4.getNode( "C1" ) ).getNodeData().getEvent().isSpeciation() ) {
183             //                return false;
184             //            }
185             //            if ( !pm.obtainLCA( g4.getNode( "B" ), g4.getNode( "C2" ) ).getNodeData().getEvent().isDuplication() ) {
186             //                return false;
187             //            }
188             //            if ( !pm.obtainLCA( g4.getNode( "B" ), g4.getNode( "D" ) ).getNodeData().getEvent().isSpeciation() ) {
189             //                return false;
190             //            }
191             //            final Phylogeny g5 = TestGSDI
192             //                    .createPhylogeny( "(((D1[&&NHX:S=D],A1[&&NHX:S=A1]),B[&&NHX:S=B]),((D2[&&NHX:S=D],D3[&&NHX:S=D]),C[&&NHX:S=C]))" );
193             //            final GSDI sdi5 = new GSDI( g5, s1, false );
194             //            if ( sdi5.getDuplicationsSum() != 3 ) {
195             //                return false;
196             //            }
197             //            if ( !pm.obtainLCA( g5.getNode( "D1" ), g5.getNode( "A1" ) ).getNodeData().getEvent().isSpeciation() ) {
198             //                return false;
199             //            }
200             //            if ( !pm.obtainLCA( g5.getNode( "D1" ), g5.getNode( "B" ) ).getNodeData().getEvent().isDuplication() ) {
201             //                return false;
202             //            }
203             //            if ( !pm.obtainLCA( g5.getNode( "D1" ), g5.getNode( "D2" ) ).getNodeData().getEvent().isDuplication() ) {
204             //                return false;
205             //            }
206             //            if ( !pm.obtainLCA( g5.getNode( "D2" ), g5.getNode( "D3" ) ).getNodeData().getEvent().isDuplication() ) {
207             //                return false;
208             //            }
209             //            if ( !pm.obtainLCA( g5.getNode( "C" ), g5.getNode( "D3" ) ).getNodeData().getEvent().isSpeciation() ) {
210             //                return false;
211             //            }
212             //            final Phylogeny species7 = TestGSDI.createPhylogeny( "(((((((([&&NHX:S=a1],[&&NHX:S=a2]),"
213             //                    + "([&&NHX:S=b1],[&&NHX:S=b2])),[&&NHX:S=x]),(([&&NHX:S=m1],[&&NHX:S=m2]),"
214             //                    + "([&&NHX:S=n1],[&&NHX:S=n2]))),(([&&NHX:S=i1],[&&NHX:S=i2]),"
215             //                    + "([&&NHX:S=j1],[&&NHX:S=j2]))),(([&&NHX:S=e1],[&&NHX:S=e2]),"
216             //                    + "([&&NHX:S=f1],[&&NHX:S=f2]))),[&&NHX:S=y]),[&&NHX:S=z])" );
217             //            final Phylogeny gene7_2 = TestGSDI
218             //                    .createPhylogeny( "(((((((((a1[&&NHX:S=a1],a2[&&NHX:S=a2]),b1[&&NHX:S=b1]),x[&&NHX:S=x]),m1[&&NHX:S=m1]),i1[&&NHX:S=i1]),j2[&&NHX:S=j2]),e1[&&NHX:S=e1]),y[&&NHX:S=y]),z[&&NHX:S=z])" );
219             //            gene7_2.setRooted( true );
220             //            final GSDI sdi7_2 = new GSDI( gene7_2, species7, false );
221             //            if ( sdi7_2.getDuplicationsSum() != 1 ) {
222             //                return false;
223             //            }
224             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "a2" ).isSpeciation() ) {
225             //                return false;
226             //            }
227             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "b1" ).isSpeciation() ) {
228             //                return false;
229             //            }
230             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "x" ).isSpeciation() ) {
231             //                return false;
232             //            }
233             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "m1" ).isSpeciation() ) {
234             //                return false;
235             //            }
236             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "i1" ).isSpeciation() ) {
237             //                return false;
238             //            }
239             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "j2" ).isDuplication() ) {
240             //                return false;
241             //            }
242             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "e1" ).isSpeciation() ) {
243             //                return false;
244             //            }
245             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "y" ).isSpeciation() ) {
246             //                return false;
247             //            }
248             //            if ( !TestGSDI.getEvent( gene7_2, "a1", "z" ).isSpeciation() ) {
249             //                return false;
250             //            }
251             //            final Phylogeny g2_0 = TestGSDI.createPhylogeny( "(m1[&&NHX:S=m1],m3[&&NHX:S=m3])" );
252             //            final GSDI sdi2_0 = new GSDI( g2_0, s2, false );
253             //            if ( sdi2_0.getDuplicationsSum() != 0 ) {
254             //                return false;
255             //            }
256             //            if ( sdi2_0.getSpeciationOrDuplicationEventsSum() != 0 ) {
257             //                return false;
258             //            }
259             //            if ( sdi2_0.getSpeciationsSum() != 1 ) {
260             //                return false;
261             //            }
262             //            if ( !pm.obtainLCA( g2_0.getNode( "m1" ), g2_0.getNode( "m3" ) ).getNodeData().getEvent().isSpeciation() ) {
263             //                return false;
264             //            }
265             //            final Phylogeny g2_1 = TestGSDI.createPhylogeny( "(e2[&&NHX:S=e2],h2[&&NHX:S=h2])" );
266             //            final GSDI sdi2_1 = new GSDI( g2_1, s2, false );
267             //            if ( sdi2_1.getDuplicationsSum() != 0 ) {
268             //                return false;
269             //            }
270             //            if ( sdi2_1.getSpeciationOrDuplicationEventsSum() != 0 ) {
271             //                return false;
272             //            }
273             //            if ( sdi2_1.getSpeciationsSum() != 1 ) {
274             //                return false;
275             //            }
276             //            if ( !pm.obtainLCA( g2_1.getNode( "e2" ), g2_1.getNode( "h2" ) ).getNodeData().getEvent().isSpeciation() ) {
277             //                return false;
278             //            }
279             //            final Phylogeny g2_2 = TestGSDI.createPhylogeny( "(e2[&&NHX:S=e2],p4[&&NHX:S=p4])" );
280             //            final GSDI sdi2_2 = new GSDI( g2_2, s2, false );
281             //            if ( sdi2_2.getDuplicationsSum() != 0 ) {
282             //                return false;
283             //            }
284             //            if ( sdi2_2.getSpeciationOrDuplicationEventsSum() != 0 ) {
285             //                return false;
286             //            }
287             //            if ( sdi2_2.getSpeciationsSum() != 1 ) {
288             //                return false;
289             //            }
290             //            if ( !pm.obtainLCA( g2_2.getNode( "e2" ), g2_2.getNode( "p4" ) ).getNodeData().getEvent().isSpeciation() ) {
291             //                return false;
292             //            }
293             //            final Phylogeny g2_3 = TestGSDI.createPhylogeny( "(e2a[&&NHX:S=e2],e2b[&&NHX:S=e2])" );
294             //            final GSDI sdi2_3 = new GSDI( g2_3, s2, false );
295             //            if ( sdi2_3.getDuplicationsSum() != 1 ) {
296             //                return false;
297             //            }
298             //            if ( sdi2_3.getSpeciationOrDuplicationEventsSum() != 0 ) {
299             //                return false;
300             //            }
301             //            if ( sdi2_3.getSpeciationsSum() != 0 ) {
302             //                return false;
303             //            }
304             //            if ( !pm.obtainLCA( g2_3.getNode( "e2a" ), g2_3.getNode( "e2b" ) ).getNodeData().getEvent().isDuplication() ) {
305             //                return false;
306             //            }
307             //            final Phylogeny g2_4 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],j4[&&NHX:S=j4]),i3[&&NHX:S=i3])" );
308             //            final GSDI sdi2_4 = new GSDI( g2_4, s2, false );
309             //            if ( sdi2_4.getDuplicationsSum() != 0 ) {
310             //                return false;
311             //            }
312             //            if ( sdi2_4.getSpeciationOrDuplicationEventsSum() != 0 ) {
313             //                return false;
314             //            }
315             //            if ( sdi2_4.getSpeciationsSum() != 2 ) {
316             //                return false;
317             //            }
318             //            if ( !pm.obtainLCA( g2_4.getNode( "j1" ), g2_4.getNode( "j4" ) ).getNodeData().getEvent().isSpeciation() ) {
319             //                return false;
320             //            }
321             //            if ( !pm.obtainLCA( g2_4.getNode( "j1" ), g2_4.getNode( "i3" ) ).getNodeData().getEvent().isSpeciation() ) {
322             //                return false;
323             //            }
324             //            final Phylogeny g2_5 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],j4[&&NHX:S=j4]),f3[&&NHX:S=f3])" );
325             //            final GSDI sdi2_5 = new GSDI( g2_5, s2, false );
326             //            if ( sdi2_5.getDuplicationsSum() != 0 ) {
327             //                return false;
328             //            }
329             //            if ( sdi2_5.getSpeciationOrDuplicationEventsSum() != 0 ) {
330             //                return false;
331             //            }
332             //            if ( sdi2_5.getSpeciationsSum() != 2 ) {
333             //                return false;
334             //            }
335             //            if ( !pm.obtainLCA( g2_5.getNode( "j1" ), g2_5.getNode( "j4" ) ).getNodeData().getEvent().isSpeciation() ) {
336             //                return false;
337             //            }
338             //            if ( !pm.obtainLCA( g2_5.getNode( "j1" ), g2_5.getNode( "f3" ) ).getNodeData().getEvent().isSpeciation() ) {
339             //                return false;
340             //            }
341             //            final Phylogeny g2_6 = TestGSDI.createPhylogeny( "((j3[&&NHX:S=j3],i4[&&NHX:S=i4]),f3[&&NHX:S=f3])" );
342             //            final GSDI sdi2_6 = new GSDI( g2_6, s2, false );
343             //            if ( sdi2_6.getDuplicationsSum() != 0 ) {
344             //                return false;
345             //            }
346             //            if ( sdi2_6.getSpeciationOrDuplicationEventsSum() != 0 ) {
347             //                return false;
348             //            }
349             //            if ( sdi2_6.getSpeciationsSum() != 2 ) {
350             //                return false;
351             //            }
352             //            if ( !pm.obtainLCA( g2_6.getNode( "j3" ), g2_6.getNode( "i4" ) ).getNodeData().getEvent().isSpeciation() ) {
353             //                return false;
354             //            }
355             //            if ( !pm.obtainLCA( g2_6.getNode( "j3" ), g2_6.getNode( "f3" ) ).getNodeData().getEvent().isSpeciation() ) {
356             //                return false;
357             //            }
358             //            final Phylogeny g2_7 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],k1[&&NHX:S=k1]),i1[&&NHX:S=i1])" );
359             //            final GSDI sdi2_7 = new GSDI( g2_7, s2, false );
360             //            if ( sdi2_7.getDuplicationsSum() != 0 ) {
361             //                return false;
362             //            }
363             //            if ( sdi2_7.getSpeciationOrDuplicationEventsSum() != 1 ) {
364             //                return false;
365             //            }
366             //            if ( sdi2_7.getSpeciationsSum() != 1 ) {
367             //                return false;
368             //            }
369             //            if ( !pm.obtainLCA( g2_7.getNode( "j1" ), g2_7.getNode( "k1" ) ).getNodeData().getEvent().isSpeciation() ) {
370             //                return false;
371             //            }
372             //            if ( !pm.obtainLCA( g2_7.getNode( "j1" ), g2_7.getNode( "i1" ) ).getNodeData().getEvent()
373             //                    .isSpeciationOrDuplication() ) {
374             //                return false;
375             //            }
376             //            final Phylogeny g2_8 = TestGSDI.createPhylogeny( "(j1[&&NHX:S=j1],(k1[&&NHX:S=k1],i1[&&NHX:S=i1]))" );
377             //            final GSDI sdi2_8 = new GSDI( g2_8, s2, false );
378             //            if ( sdi2_8.getDuplicationsSum() != 0 ) {
379             //                return false;
380             //            }
381             //            if ( sdi2_8.getSpeciationOrDuplicationEventsSum() != 1 ) {
382             //                return false;
383             //            }
384             //            if ( sdi2_8.getSpeciationsSum() != 1 ) {
385             //                return false;
386             //            }
387             //            if ( !pm.obtainLCA( g2_8.getNode( "j1" ), g2_8.getNode( "k1" ) ).getNodeData().getEvent()
388             //                    .isSpeciationOrDuplication() ) {
389             //                return false;
390             //            }
391             //            if ( !pm.obtainLCA( g2_8.getNode( "k1" ), g2_8.getNode( "i1" ) ).getNodeData().getEvent().isSpeciation() ) {
392             //                return false;
393             //            }
394             //            final Phylogeny g2_9 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],k4[&&NHX:S=k4]),f2[&&NHX:S=f2])" );
395             //            final GSDI sdi2_9 = new GSDI( g2_9, s2, false );
396             //            if ( sdi2_9.getDuplicationsSum() != 0 ) {
397             //                return false;
398             //            }
399             //            if ( sdi2_9.getSpeciationOrDuplicationEventsSum() != 0 ) {
400             //                return false;
401             //            }
402             //            if ( sdi2_9.getSpeciationsSum() != 2 ) {
403             //                return false;
404             //            }
405             //            if ( !TestGSDI.getEvent( g2_9, "j1", "k4" ).isSpeciation() ) {
406             //                return false;
407             //            }
408             //            if ( !TestGSDI.getEvent( g2_9, "j1", "f2" ).isSpeciation() ) {
409             //                return false;
410             //            }
411             //            final Phylogeny g2_10 = TestGSDI.createPhylogeny( "((m1[&&NHX:S=m1],k4[&&NHX:S=k4]),f2[&&NHX:S=f2])" );
412             //            final GSDI sdi2_10 = new GSDI( g2_10, s2, false );
413             //            if ( sdi2_10.getDuplicationsSum() != 0 ) {
414             //                return false;
415             //            }
416             //            if ( sdi2_10.getSpeciationOrDuplicationEventsSum() != 1 ) {
417             //                return false;
418             //            }
419             //            if ( sdi2_10.getSpeciationsSum() != 1 ) {
420             //                return false;
421             //            }
422             //            if ( !TestGSDI.getEvent( g2_10, "m1", "k4" ).isSpeciation() ) {
423             //                return false;
424             //            }
425             //            if ( !TestGSDI.getEvent( g2_10, "m1", "f2" ).isSpeciationOrDuplication() ) {
426             //                return false;
427             //            }
428             //            final Phylogeny g2_11 = TestGSDI.createPhylogeny( "((m1[&&NHX:S=m1],k4[&&NHX:S=k4]),x[&&NHX:S=x])" );
429             //            final GSDI sdi2_11 = new GSDI( g2_11, s2, false );
430             //            if ( sdi2_11.getDuplicationsSum() != 0 ) {
431             //                return false;
432             //            }
433             //            if ( sdi2_11.getSpeciationOrDuplicationEventsSum() != 1 ) {
434             //                return false;
435             //            }
436             //            if ( sdi2_11.getSpeciationsSum() != 1 ) {
437             //                return false;
438             //            }
439             //            if ( !TestGSDI.getEvent( g2_11, "m1", "k4" ).isSpeciation() ) {
440             //                return false;
441             //            }
442             //            if ( !TestGSDI.getEvent( g2_11, "m1", "x" ).isSpeciationOrDuplication() ) {
443             //                return false;
444             //            }
445             //            final Phylogeny g2_12 = TestGSDI.createPhylogeny( "(m1[&&NHX:S=m1],(k4[&&NHX:S=k4],x[&&NHX:S=x]))" );
446             //            final GSDI sdi2_12 = new GSDI( g2_12, s2, false );
447             //            if ( sdi2_12.getDuplicationsSum() != 0 ) {
448             //                return false;
449             //            }
450             //            if ( sdi2_12.getSpeciationOrDuplicationEventsSum() != 1 ) {
451             //                return false;
452             //            }
453             //            if ( sdi2_12.getSpeciationsSum() != 1 ) {
454             //                return false;
455             //            }
456             //            if ( !TestGSDI.getEvent( g2_12, "x", "k4" ).isSpeciation() ) {
457             //                return false;
458             //            }
459             //            if ( !TestGSDI.getEvent( g2_12, "m1", "x" ).isSpeciationOrDuplication() ) {
460             //                return false;
461             //            }
462             //            final Phylogeny g2_13 = TestGSDI.createPhylogeny( "(x[&&NHX:S=x],(y[&&NHX:S=y],z[&&NHX:S=z]))" );
463             //            final GSDI sdi2_13 = new GSDI( g2_13, s2, false );
464             //            if ( sdi2_13.getDuplicationsSum() != 0 ) {
465             //                return false;
466             //            }
467             //            if ( sdi2_13.getSpeciationOrDuplicationEventsSum() != 1 ) {
468             //                return false;
469             //            }
470             //            if ( sdi2_13.getSpeciationsSum() != 1 ) {
471             //                return false;
472             //            }
473             //            if ( !TestGSDI.getEvent( g2_13, "y", "z" ).isSpeciation() ) {
474             //                return false;
475             //            }
476             //            if ( !TestGSDI.getEvent( g2_13, "x", "z" ).isSpeciationOrDuplication() ) {
477             //                return false;
478             //            }
479             //            final Phylogeny g2_14 = TestGSDI.createPhylogeny( "(a1_1[&&NHX:S=a1],(b1[&&NHX:S=b1],a1[&&NHX:S=a1]))" );
480             //            final GSDI sdi2_14 = new GSDI( g2_14, s2, false );
481             //            if ( sdi2_14.getDuplicationsSum() != 1 ) {
482             //                return false;
483             //            }
484             //            if ( sdi2_14.getSpeciationOrDuplicationEventsSum() != 0 ) {
485             //                return false;
486             //            }
487             //            if ( sdi2_14.getSpeciationsSum() != 1 ) {
488             //                return false;
489             //            }
490             //            if ( !TestGSDI.getEvent( g2_14, "b1", "a1" ).isSpeciation() ) {
491             //                return false;
492             //            }
493             //            if ( !TestGSDI.getEvent( g2_14, "b1", "a1_1" ).isDuplication() ) {
494             //                return false;
495             //            }
496             //            final Phylogeny g2_15 = TestGSDI.createPhylogeny( "(a2[&&NHX:S=a2],(b1[&&NHX:S=b1],a1[&&NHX:S=a1]))" );
497             //            final GSDI sdi2_15 = new GSDI( g2_15, s2, false );
498             //            if ( sdi2_15.getDuplicationsSum() != 1 ) {
499             //                return false;
500             //            }
501             //            if ( sdi2_15.getSpeciationOrDuplicationEventsSum() != 0 ) {
502             //                return false;
503             //            }
504             //            if ( sdi2_15.getSpeciationsSum() != 1 ) {
505             //                return false;
506             //            }
507             //            if ( !TestGSDI.getEvent( g2_15, "b1", "a1" ).isSpeciation() ) {
508             //                return false;
509             //            }
510             //            if ( !TestGSDI.getEvent( g2_15, "b1", "a2" ).isDuplication() ) {
511             //                return false;
512             //            }
513             //            final Phylogeny g2_16 = TestGSDI.createPhylogeny( "(n2[&&NHX:S=n2],(j3[&&NHX:S=j3],n1[&&NHX:S=n1]))" );
514             //            final GSDI sdi2_16 = new GSDI( g2_16, s2, false );
515             //            if ( sdi2_16.getDuplicationsSum() != 1 ) {
516             //                return false;
517             //            }
518             //            if ( sdi2_16.getSpeciationOrDuplicationEventsSum() != 0 ) {
519             //                return false;
520             //            }
521             //            if ( sdi2_16.getSpeciationsSum() != 1 ) {
522             //                return false;
523             //            }
524             //            if ( !TestGSDI.getEvent( g2_16, "j3", "n1" ).isSpeciation() ) {
525             //                return false;
526             //            }
527             //            if ( !TestGSDI.getEvent( g2_16, "j3", "n2" ).isDuplication() ) {
528             //                return false;
529             //            }
530             //            final Phylogeny g2_17 = TestGSDI.createPhylogeny( "(p4[&&NHX:S=p4],(j3[&&NHX:S=j3],n1[&&NHX:S=n1]))" );
531             //            final GSDI sdi2_17 = new GSDI( g2_17, s2, false );
532             //            if ( sdi2_17.getDuplicationsSum() != 1 ) {
533             //                return false;
534             //            }
535             //            if ( sdi2_17.getSpeciationOrDuplicationEventsSum() != 0 ) {
536             //                return false;
537             //            }
538             //            if ( sdi2_17.getSpeciationsSum() != 1 ) {
539             //                return false;
540             //            }
541             //            if ( !TestGSDI.getEvent( g2_17, "j3", "n1" ).isSpeciation() ) {
542             //                return false;
543             //            }
544             //            if ( !TestGSDI.getEvent( g2_17, "j3", "p4" ).isDuplication() ) {
545             //                return false;
546             //            }
547             //            final Phylogeny g2_18 = TestGSDI
548             //                    .createPhylogeny( "((n11[&&NHX:S=n1],n12[&&NHX:S=n1]),(n13[&&NHX:S=n1],n14[&&NHX:S=n1]))" );
549             //            final GSDI sdi2_18 = new GSDI( g2_18, s2, false );
550             //            if ( sdi2_18.getDuplicationsSum() != 3 ) {
551             //                return false;
552             //            }
553             //            if ( sdi2_18.getSpeciationOrDuplicationEventsSum() != 0 ) {
554             //                return false;
555             //            }
556             //            if ( sdi2_18.getSpeciationsSum() != 0 ) {
557             //                return false;
558             //            }
559             //            if ( !TestGSDI.getEvent( g2_18, "n11", "n12" ).isDuplication() ) {
560             //                return false;
561             //            }
562             //            if ( !TestGSDI.getEvent( g2_18, "n13", "n14" ).isDuplication() ) {
563             //                return false;
564             //            }
565             //            if ( !TestGSDI.getEvent( g2_18, "n11", "n13" ).isDuplication() ) {
566             //                return false;
567             //            }
568             //            final Phylogeny g2_19 = TestGSDI
569             //                    .createPhylogeny( "((n11[&&NHX:S=n1],n21[&&NHX:S=n2]),(n12[&&NHX:S=n1],n22[&&NHX:S=n2]))" );
570             //            final GSDI sdi2_19 = new GSDI( g2_19, s2, false );
571             //            if ( sdi2_19.getDuplicationsSum() != 1 ) {
572             //                return false;
573             //            }
574             //            if ( sdi2_19.getSpeciationOrDuplicationEventsSum() != 0 ) {
575             //                return false;
576             //            }
577             //            if ( sdi2_19.getSpeciationsSum() != 2 ) {
578             //                return false;
579             //            }
580             //            if ( !TestGSDI.getEvent( g2_19, "n11", "n21" ).isSpeciation() ) {
581             //                return false;
582             //            }
583             //            if ( !TestGSDI.getEvent( g2_19, "n12", "n22" ).isSpeciation() ) {
584             //                return false;
585             //            }
586             //            if ( !TestGSDI.getEvent( g2_19, "n11", "n12" ).isDuplication() ) {
587             //                return false;
588             //            }
589             //            final Phylogeny g2_20 = TestGSDI
590             //                    .createPhylogeny( "((n11[&&NHX:S=n1],n2[&&NHX:S=n2]),(n12[&&NHX:S=n1],n3[&&NHX:S=n3]))" );
591             //            final GSDI sdi2_20 = new GSDI( g2_20, s2, false );
592             //            if ( sdi2_20.getDuplicationsSum() != 1 ) {
593             //                return false;
594             //            }
595             //            if ( sdi2_20.getSpeciationOrDuplicationEventsSum() != 0 ) {
596             //                return false;
597             //            }
598             //            if ( sdi2_20.getSpeciationsSum() != 2 ) {
599             //                return false;
600             //            }
601             //            if ( !TestGSDI.getEvent( g2_20, "n11", "n2" ).isSpeciation() ) {
602             //                return false;
603             //            }
604             //            if ( !TestGSDI.getEvent( g2_20, "n12", "n3" ).isSpeciation() ) {
605             //                return false;
606             //            }
607             //            if ( !TestGSDI.getEvent( g2_20, "n11", "n12" ).isDuplication() ) {
608             //                return false;
609             //            }
610             //            final Phylogeny g2_21 = TestGSDI
611             //                    .createPhylogeny( "((n1[&&NHX:S=n1],n2[&&NHX:S=n2]),(n3[&&NHX:S=n3],a1[&&NHX:S=a1]))" );
612             //            final GSDI sdi2_21 = new GSDI( g2_21, s2, false );
613             //            if ( sdi2_21.getDuplicationsSum() != 1 ) {
614             //                return false;
615             //            }
616             //            if ( sdi2_21.getSpeciationOrDuplicationEventsSum() != 0 ) {
617             //                return false;
618             //            }
619             //            if ( sdi2_21.getSpeciationsSum() != 2 ) {
620             //                return false;
621             //            }
622             //            if ( !TestGSDI.getEvent( g2_21, "n1", "n2" ).isSpeciation() ) {
623             //                return false;
624             //            }
625             //            if ( !TestGSDI.getEvent( g2_21, "n3", "a1" ).isSpeciation() ) {
626             //                return false;
627             //            }
628             //            if ( !TestGSDI.getEvent( g2_21, "n2", "a1" ).isDuplication() ) {
629             //                return false;
630             //            }
631             //            final Phylogeny g2_22 = TestGSDI
632             //                    .createPhylogeny( "((n1[&&NHX:S=n1],n2[&&NHX:S=n2]),(n3[&&NHX:S=n3],n4[&&NHX:S=n4]))" );
633             //            final GSDI sdi2_22 = new GSDI( g2_22, s2, false );
634             //            //Archaeopteryx.createApplication( g2_22 );
635             //            //Archaeopteryx.createApplication( s2 );
636             //            if ( sdi2_22.getDuplicationsSum() != 0 ) {
637             //                return false;
638             //            }
639             //            if ( sdi2_22.getSpeciationOrDuplicationEventsSum() != 1 ) {
640             //                return false;
641             //            }
642             //            if ( sdi2_22.getSpeciationsSum() != 2 ) {
643             //                return false;
644             //            }
645             //            if ( !TestGSDI.getEvent( g2_22, "n1", "n2" ).isSpeciation() ) {
646             //                return false;
647             //            }
648             //            if ( !TestGSDI.getEvent( g2_22, "n3", "n4" ).isSpeciation() ) {
649             //                return false;
650             //            }
651             //            if ( !TestGSDI.getEvent( g2_22, "n1", "n3" ).isSpeciationOrDuplication() ) {
652             //                return false;
653             //            }
654             //            final Phylogeny g2_23 = TestGSDI
655             //                    .createPhylogeny( "((a1[&&NHX:S=a1],b1[&&NHX:S=b1]),(c1[&&NHX:S=c1],d1[&&NHX:S=d1]))" );
656             //            final GSDI sdi2_23 = new GSDI( g2_23, s2, false );
657             //            if ( sdi2_23.getDuplicationsSum() != 0 ) {
658             //                return false;
659             //            }
660             //            if ( sdi2_23.getSpeciationOrDuplicationEventsSum() != 1 ) {
661             //                return false;
662             //            }
663             //            if ( sdi2_23.getSpeciationsSum() != 2 ) {
664             //                return false;
665             //            }
666             //            if ( !TestGSDI.getEvent( g2_23, "a1", "b1" ).isSpeciation() ) {
667             //                return false;
668             //            }
669             //            if ( !TestGSDI.getEvent( g2_23, "c1", "d1" ).isSpeciation() ) {
670             //                return false;
671             //            }
672             //            if ( !TestGSDI.getEvent( g2_23, "a1", "c1" ).isSpeciationOrDuplication() ) {
673             //                return false;
674             //            }
675             //            final Phylogeny g2_24 = TestGSDI
676             //                    .createPhylogeny( "((a1[&&NHX:S=a1],e1[&&NHX:S=e1]),(i1[&&NHX:S=i1],m1[&&NHX:S=m1]))" );
677             //            final GSDI sdi2_24 = new GSDI( g2_24, s2, false );
678             //            if ( sdi2_24.getDuplicationsSum() != 0 ) {
679             //                return false;
680             //            }
681             //            if ( sdi2_24.getSpeciationOrDuplicationEventsSum() != 1 ) {
682             //                return false;
683             //            }
684             //            if ( sdi2_24.getSpeciationsSum() != 2 ) {
685             //                return false;
686             //            }
687             //            if ( !TestGSDI.getEvent( g2_24, "a1", "e1" ).isSpeciation() ) {
688             //                return false;
689             //            }
690             //            if ( !TestGSDI.getEvent( g2_24, "i1", "m1" ).isSpeciation() ) {
691             //                return false;
692             //            }
693             //            if ( !TestGSDI.getEvent( g2_24, "a1", "i1" ).isSpeciationOrDuplication() ) {
694             //                return false;
695             //            }
696             //            final Phylogeny g2_25 = TestGSDI
697             //                    .createPhylogeny( "((a1[&&NHX:S=a1],a4[&&NHX:S=a4]),(b1[&&NHX:S=b1],c1[&&NHX:S=c1]))" );
698             //            final GSDI sdi2_25 = new GSDI( g2_25, s2, false );
699             //            if ( sdi2_25.getDuplicationsSum() != 0 ) {
700             //                return false;
701             //            }
702             //            if ( sdi2_25.getSpeciationOrDuplicationEventsSum() != 1 ) {
703             //                return false;
704             //            }
705             //            if ( sdi2_25.getSpeciationsSum() != 2 ) {
706             //                return false;
707             //            }
708             //            if ( !TestGSDI.getEvent( g2_25, "a1", "a4" ).isSpeciation() ) {
709             //                return false;
710             //            }
711             //            if ( !TestGSDI.getEvent( g2_25, "b1", "c1" ).isSpeciation() ) {
712             //                return false;
713             //            }
714             //            if ( !TestGSDI.getEvent( g2_25, "a1", "b1" ).isSpeciationOrDuplication() ) {
715             //                return false;
716             //            }
717             //            final Phylogeny g2_26 = TestGSDI
718             //                    .createPhylogeny( "(((a1[&&NHX:S=a1],a4[&&NHX:S=a4]),b1[&&NHX:S=b1]),e1[&&NHX:S=e1])" );
719             //            final GSDI sdi2_26 = new GSDI( g2_26, s2, false );
720             //            if ( sdi2_26.getDuplicationsSum() != 0 ) {
721             //                return false;
722             //            }
723             //            if ( sdi2_26.getSpeciationOrDuplicationEventsSum() != 0 ) {
724             //                return false;
725             //            }
726             //            if ( sdi2_26.getSpeciationsSum() != 3 ) {
727             //                return false;
728             //            }
729             //            if ( !TestGSDI.getEvent( g2_26, "a1", "a4" ).isSpeciation() ) {
730             //                return false;
731             //            }
732             //            if ( !TestGSDI.getEvent( g2_26, "a1", "b1" ).isSpeciation() ) {
733             //                return false;
734             //            }
735             //            if ( !TestGSDI.getEvent( g2_26, "a1", "e1" ).isSpeciation() ) {
736             //                return false;
737             //            }
738             //            final Phylogeny g2_27 = TestGSDI
739             //                    .createPhylogeny( "(((a1[&&NHX:S=a1],a4[&&NHX:S=a4]),b1[&&NHX:S=b1]),c1[&&NHX:S=c1])" );
740             //            final GSDI sdi2_27 = new GSDI( g2_27, s2, false );
741             //            if ( sdi2_27.getDuplicationsSum() != 0 ) {
742             //                return false;
743             //            }
744             //            if ( sdi2_27.getSpeciationOrDuplicationEventsSum() != 1 ) {
745             //                return false;
746             //            }
747             //            if ( sdi2_27.getSpeciationsSum() != 2 ) {
748             //                return false;
749             //            }
750             //            if ( !TestGSDI.getEvent( g2_27, "a1", "a4" ).isSpeciation() ) {
751             //                return false;
752             //            }
753             //            if ( !TestGSDI.getEvent( g2_27, "a1", "b1" ).isSpeciation() ) {
754             //                return false;
755             //            }
756             //            if ( !TestGSDI.getEvent( g2_27, "a1", "c1" ).isSpeciationOrDuplication() ) {
757             //                return false;
758             //            }
759             //            final Phylogeny g2_28 = TestGSDI
760             //                    .createPhylogeny( "(((a1[&&NHX:S=a1],b1[&&NHX:S=b1]),c1[&&NHX:S=c1]),e1[&&NHX:S=e1])" );
761             //            final GSDI sdi2_28 = new GSDI( g2_28, s2, false );
762             //            if ( sdi2_28.getDuplicationsSum() != 0 ) {
763             //                return false;
764             //            }
765             //            if ( sdi2_28.getSpeciationOrDuplicationEventsSum() != 1 ) {
766             //                return false;
767             //            }
768             //            if ( sdi2_28.getSpeciationsSum() != 2 ) {
769             //                return false;
770             //            }
771             //            if ( !TestGSDI.getEvent( g2_28, "a1", "b1" ).isSpeciation() ) {
772             //                return false;
773             //            }
774             //            if ( !TestGSDI.getEvent( g2_28, "a1", "c1" ).isSpeciationOrDuplication() ) {
775             //                return false;
776             //            }
777             //            if ( !TestGSDI.getEvent( g2_28, "a1", "e1" ).isSpeciation() ) {
778             //                return false;
779             //            }
780             //            final Phylogeny g2_29 = TestGSDI
781             //                    .createPhylogeny( "(((a1[&&NHX:S=a1],b1[&&NHX:S=b1]),c1[&&NHX:S=c1]),d1[&&NHX:S=d1])" );
782             //            final GSDI sdi2_29 = new GSDI( g2_29, s2, false );
783             //            if ( sdi2_29.getDuplicationsSum() != 0 ) {
784             //                return false;
785             //            }
786             //            if ( sdi2_29.getSpeciationOrDuplicationEventsSum() != 2 ) {
787             //                return false;
788             //            }
789             //            if ( sdi2_29.getSpeciationsSum() != 1 ) {
790             //                return false;
791             //            }
792             //            if ( !TestGSDI.getEvent( g2_29, "a1", "b1" ).isSpeciation() ) {
793             //                return false;
794             //            }
795             //            if ( !TestGSDI.getEvent( g2_29, "a1", "c1" ).isSpeciationOrDuplication() ) {
796             //                return false;
797             //            }
798             //            if ( !TestGSDI.getEvent( g2_29, "a1", "d1" ).isSpeciationOrDuplication() ) {
799             //                return false;
800             //            }
801             //            final Phylogeny g2_30 = TestGSDI
802             //                    .createPhylogeny( "(((a1[&&NHX:S=a1],b1[&&NHX:S=b1]),c1[&&NHX:S=c1]),a2[&&NHX:S=a2])" );
803             //            final GSDI sdi2_30 = new GSDI( g2_30, s2, false );
804             //            if ( sdi2_30.getDuplicationsSum() != 1 ) {
805             //                return false;
806             //            }
807             //            if ( sdi2_30.getSpeciationOrDuplicationEventsSum() != 1 ) {
808             //                return false;
809             //            }
810             //            if ( sdi2_30.getSpeciationsSum() != 1 ) {
811             //                return false;
812             //            }
813             //            if ( !TestGSDI.getEvent( g2_30, "a1", "b1" ).isSpeciation() ) {
814             //                return false;
815             //            }
816             //            if ( !TestGSDI.getEvent( g2_30, "a1", "c1" ).isSpeciationOrDuplication() ) {
817             //                return false;
818             //            }
819             //            if ( !TestGSDI.getEvent( g2_30, "a1", "a2" ).isDuplication() ) {
820             //                return false;
821             //            }
822             //            final Phylogeny g2_31 = TestGSDI
823             //                    .createPhylogeny( "(((a1[&&NHX:S=a1],b1[&&NHX:S=b1]),c1[&&NHX:S=c1]),c2[&&NHX:S=c2])" );
824             //            final GSDI sdi2_31 = new GSDI( g2_31, s2, false );
825             //            if ( sdi2_31.getDuplicationsSum() != 1 ) {
826             //                return false;
827             //            }
828             //            if ( sdi2_31.getSpeciationOrDuplicationEventsSum() != 1 ) {
829             //                return false;
830             //            }
831             //            if ( sdi2_31.getSpeciationsSum() != 1 ) {
832             //                return false;
833             //            }
834             //            if ( !TestGSDI.getEvent( g2_31, "a1", "b1" ).isSpeciation() ) {
835             //                return false;
836             //            }
837             //            if ( !TestGSDI.getEvent( g2_31, "a1", "c1" ).isSpeciationOrDuplication() ) {
838             //                return false;
839             //            }
840             //            if ( !TestGSDI.getEvent( g2_31, "a1", "c2" ).isDuplication() ) {
841             //                return false;
842             //            }
843             //            final Phylogeny g2_32 = TestGSDI
844             //                    .createPhylogeny( "((((((((((a1[&&NHX:S=a1],a2[&&NHX:S=a2]),b1[&&NHX:S=b1]),c1[&&NHX:S=c1]),d1[&&NHX:S=d1]),x[&&NHX:S=x]),p1[&&NHX:S=p1]),i1[&&NHX:S=i1]),e1[&&NHX:S=e1]),y[&&NHX:S=y]),z[&&NHX:S=z])" );
845             //            final GSDI sdi2_32 = new GSDI( g2_32, s2, false );
846             //            if ( sdi2_32.getDuplicationsSum() != 0 ) {
847             //                return false;
848             //            }
849             //            if ( sdi2_32.getSpeciationOrDuplicationEventsSum() != 7 ) {
850             //                return false;
851             //            }
852             //            if ( sdi2_32.getSpeciationsSum() != 3 ) {
853             //                return false;
854             //            }
855             //            if ( !TestGSDI.getEvent( g2_32, "a1", "a2" ).isSpeciation() ) {
856             //                return false;
857             //            }
858             //            if ( !TestGSDI.getEvent( g2_32, "a1", "b1" ).isSpeciation() ) {
859             //                return false;
860             //            }
861             //            if ( !TestGSDI.getEvent( g2_32, "a1", "c1" ).isSpeciationOrDuplication() ) {
862             //                return false;
863             //            }
864             //            if ( !TestGSDI.getEvent( g2_32, "a1", "d1" ).isSpeciationOrDuplication() ) {
865             //                return false;
866             //            }
867             //            if ( !TestGSDI.getEvent( g2_32, "a1", "x" ).isSpeciation() ) {
868             //                return false;
869             //            }
870             //            if ( !TestGSDI.getEvent( g2_32, "a1", "p1" ).isSpeciationOrDuplication() ) {
871             //                return false;
872             //            }
873             //            if ( !TestGSDI.getEvent( g2_32, "a1", "i1" ).isSpeciationOrDuplication() ) {
874             //                return false;
875             //            }
876             //            if ( !TestGSDI.getEvent( g2_32, "a1", "e1" ).isSpeciationOrDuplication() ) {
877             //                return false;
878             //            }
879             //            if ( !TestGSDI.getEvent( g2_32, "a1", "y" ).isSpeciationOrDuplication() ) {
880             //                return false;
881             //            }
882             //            if ( !TestGSDI.getEvent( g2_32, "a1", "z" ).isSpeciationOrDuplication() ) {
883             //                return false;
884             //            }
885             //            //            //-
886             //            final Phylogeny g2_33_d = TestGSDI
887             //                    .createPhylogeny( "((((((((((((a1[&&NHX:S=a1],a2[&&NHX:S=a2])[&&NHX:D=N],b1[&&NHX:S=b1])[&&NHX:D=N],c1[&&NHX:S=c1])[&&NHX:D=?],d1[&&NHX:S=d1])[&&NHX:D=?],x[&&NHX:S=x])[&&NHX:D=N],p1[&&NHX:S=p1])[&&NHX:D=?],i1[&&NHX:S=i1])[&&NHX:D=?],k2[&&NHX:S=k2])[&&NHX:D=Y],e1[&&NHX:S=e1])[&&NHX:D=Y],y[&&NHX:S=y])[&&NHX:D=Y],z[&&NHX:S=z])[&&NHX:D=?],(((((((((((a1[&&NHX:S=a1],a2[&&NHX:S=a2])[&&NHX:D=N],b1[&&NHX:S=b1])[&&NHX:D=N],c1[&&NHX:S=c1])[&&NHX:D=?],d1[&&NHX:S=d1])[&&NHX:D=?],x[&&NHX:S=x])[&&NHX:D=N],p1[&&NHX:S=p1])[&&NHX:D=?],i1[&&NHX:S=i1])[&&NHX:D=?],k2[&&NHX:S=k2])[&&NHX:D=Y],e1[&&NHX:S=e1])[&&NHX:D=Y],y[&&NHX:S=y])[&&NHX:D=Y],z[&&NHX:S=z])[&&NHX:D=?])" );
888             //            final GSDI sdi2_33_d = new GSDI( g2_33_d, s2, false );
889             //            Archaeopteryx.createApplication( g2_33_d );
890             //            //  Archaeopteryx.createApplication( s2 );
891             //            //-
892             //            final Phylogeny g2_33 = TestGSDI
893             //                    .createPhylogeny( "(((((((((((a1[&&NHX:S=a1],a2[&&NHX:S=a2]),b1[&&NHX:S=b1]),c1[&&NHX:S=c1]),d1[&&NHX:S=d1]),x[&&NHX:S=x]),p1[&&NHX:S=p1]),i1[&&NHX:S=i1]),k2[&&NHX:S=k2]),e1[&&NHX:S=e1]),y[&&NHX:S=y]),z[&&NHX:S=z])" );
894             //            final GSDI sdi2_33 = new GSDI( g2_33, s2, false );
895             //            Archaeopteryx.createApplication( g2_33 );
896             //            Archaeopteryx.createApplication( s2 );
897             //            if ( sdi2_33.getDuplicationsSum() != 1 ) {
898             //                return false;
899             //            }
900             //            if ( sdi2_33.getSpeciationOrDuplicationEventsSum() != 7 ) {
901             //                return false;
902             //            }
903             //            if ( sdi2_33.getSpeciationsSum() != 3 ) {
904             //                return false;
905             //            }
906             //            if ( !TestGSDI.getEvent( g2_33, "a1", "a2" ).isSpeciation() ) {
907             //                return false;
908             //            }
909             //            if ( !TestGSDI.getEvent( g2_33, "a1", "b1" ).isSpeciation() ) {
910             //                return false;
911             //            }
912             //            if ( !TestGSDI.getEvent( g2_33, "a1", "c1" ).isSpeciationOrDuplication() ) {
913             //                return false;
914             //            }
915             //            if ( !TestGSDI.getEvent( g2_33, "a1", "d1" ).isSpeciationOrDuplication() ) {
916             //                return false;
917             //            }
918             //            if ( !TestGSDI.getEvent( g2_33, "a1", "x" ).isSpeciation() ) {
919             //                return false;
920             //            }
921             //            if ( !TestGSDI.getEvent( g2_33, "a1", "p1" ).isSpeciationOrDuplication() ) {
922             //                return false;
923             //            }
924             //            if ( !TestGSDI.getEvent( g2_33, "a1", "i1" ).isSpeciationOrDuplication() ) {
925             //                return false;
926             //            }
927             //            if ( !TestGSDI.getEvent( g2_33, "a1", "k2" ).isDuplication() ) {
928             //                return false;
929             //            }
930             //            if ( !TestGSDI.getEvent( g2_33, "a1", "e1" ).isSpeciationOrDuplication() ) {
931             //                return false;
932             //            }
933             //            if ( !TestGSDI.getEvent( g2_33, "a1", "y" ).isSpeciationOrDuplication() ) {
934             //                return false;
935             //            }
936             //            if ( !TestGSDI.getEvent( g2_33, "a1", "z" ).isSpeciationOrDuplication() ) {
937             //                return false;
938             //            }
939             //            final Phylogeny g2_34 = TestGSDI
940             //                    .createPhylogeny( "(((n1_0[&&NHX:S=n1],n2_0[&&NHX:S=n2]),(n1_1[&&NHX:S=n1],n3_0[&&NHX:S=n3])),n4_0[&&NHX:S=n4])" );
941             //            final GSDI sdi2_34 = new GSDI( g2_34, s2, false );
942             //            if ( sdi2_34.getDuplicationsSum() != 1 ) {
943             //                return false;
944             //            }
945             //            if ( sdi2_34.getSpeciationOrDuplicationEventsSum() != 1 ) {
946             //                return false;
947             //            }
948             //            if ( sdi2_34.getSpeciationsSum() != 2 ) {
949             //                return false;
950             //            }
951             //            if ( !TestGSDI.getEvent( g2_34, "n1_0", "n2_0" ).isSpeciation() ) {
952             //                return false;
953             //            }
954             //            if ( !TestGSDI.getEvent( g2_34, "n1_1", "n3_0" ).isSpeciation() ) {
955             //                return false;
956             //            }
957             //            if ( !TestGSDI.getEvent( g2_34, "n1_0", "n1_1" ).isDuplication() ) {
958             //                return false;
959             //            }
960             //            if ( !TestGSDI.getEvent( g2_34, "n1_0", "n4_0" ).isSpeciationOrDuplication() ) {
961             //                return false;
962             //            }
963             //            final Phylogeny g2_35 = TestGSDI
964             //                    .createPhylogeny( "((((n1_0[&&NHX:S=n1],n2_0[&&NHX:S=n2]),(n1_1[&&NHX:S=n1],n3_0[&&NHX:S=n3])),n4_0[&&NHX:S=n4]),a1_0[&&NHX:S=a1])" );
965             //            final GSDI sdi2_35 = new GSDI( g2_35, s2, false );
966             //            if ( sdi2_35.getDuplicationsSum() != 1 ) {
967             //                return false;
968             //            }
969             //            if ( sdi2_35.getSpeciationOrDuplicationEventsSum() != 1 ) {
970             //                return false;
971             //            }
972             //            if ( sdi2_35.getSpeciationsSum() != 3 ) {
973             //                return false;
974             //            }
975             //            if ( !TestGSDI.getEvent( g2_35, "n1_0", "n2_0" ).isSpeciation() ) {
976             //                return false;
977             //            }
978             //            if ( !TestGSDI.getEvent( g2_35, "n1_1", "n3_0" ).isSpeciation() ) {
979             //                return false;
980             //            }
981             //            if ( !TestGSDI.getEvent( g2_35, "n1_0", "n1_1" ).isDuplication() ) {
982             //                return false;
983             //            }
984             //            if ( !TestGSDI.getEvent( g2_35, "n1_0", "n4_0" ).isSpeciationOrDuplication() ) {
985             //                return false;
986             //            }
987             //            if ( !TestGSDI.getEvent( g2_35, "n1_0", "a1_0" ).isSpeciation() ) {
988             //                return false;
989             //            }
990             //            final Phylogeny g2_36 = TestGSDI
991             //                    .createPhylogeny( "(((a1_0[&&NHX:S=a1],b1_0[&&NHX:S=b1]),(a1_1[&&NHX:S=a1],c1_0[&&NHX:S=c1])),d1_0[&&NHX:S=d1])" );
992             //            final GSDI sdi2_36 = new GSDI( g2_36, s2, false );
993             //            if ( sdi2_36.getDuplicationsSum() != 1 ) {
994             //                return false;
995             //            }
996             //            if ( sdi2_36.getSpeciationOrDuplicationEventsSum() != 1 ) {
997             //                return false;
998             //            }
999             //            if ( sdi2_36.getSpeciationsSum() != 2 ) {
1000             //                return false;
1001             //            }
1002             //            if ( !TestGSDI.getEvent( g2_36, "a1_0", "b1_0" ).isSpeciation() ) {
1003             //                return false;
1004             //            }
1005             //            if ( !TestGSDI.getEvent( g2_36, "a1_1", "c1_0" ).isSpeciation() ) {
1006             //                return false;
1007             //            }
1008             //            if ( !TestGSDI.getEvent( g2_36, "a1_0", "c1_0" ).isDuplication() ) {
1009             //                return false;
1010             //            }
1011             //            if ( !TestGSDI.getEvent( g2_36, "a1_0", "d1_0" ).isSpeciationOrDuplication() ) {
1012             //                return false;
1013             //            }
1014             //            final Phylogeny g2_37 = TestGSDI
1015             //                    .createPhylogeny( "(((a1_0[&&NHX:S=a1],b1_0[&&NHX:S=b1]),(a2_0[&&NHX:S=a2],c1_0[&&NHX:S=c1])),d1_0[&&NHX:S=d1])" );
1016             //            final GSDI sdi2_37 = new GSDI( g2_37, s2, false );
1017             //            if ( sdi2_37.getDuplicationsSum() != 1 ) {
1018             //                return false;
1019             //            }
1020             //            if ( sdi2_37.getSpeciationOrDuplicationEventsSum() != 1 ) {
1021             //                return false;
1022             //            }
1023             //            if ( sdi2_37.getSpeciationsSum() != 2 ) {
1024             //                return false;
1025             //            }
1026             //            if ( !TestGSDI.getEvent( g2_37, "a1_0", "b1_0" ).isSpeciation() ) {
1027             //                return false;
1028             //            }
1029             //            if ( !TestGSDI.getEvent( g2_37, "a2_0", "c1_0" ).isSpeciation() ) {
1030             //                return false;
1031             //            }
1032             //            if ( !TestGSDI.getEvent( g2_37, "a1_0", "c1_0" ).isDuplication() ) {
1033             //                return false;
1034             //            }
1035             //            if ( !TestGSDI.getEvent( g2_37, "a1_0", "d1_0" ).isSpeciationOrDuplication() ) {
1036             //                return false;
1037             //            }
1038             //            final Phylogeny g2_38 = TestGSDI
1039             //                    .createPhylogeny( "(((([&&NHX:S=n1],[&&NHX:S=n1]),([&&NHX:S=n1],[&&NHX:S=n1])),[&&NHX:S=n1]),[&&NHX:S=n1])" );
1040             //            final GSDI sdi2_38 = new GSDI( g2_38, s2, false );
1041             //            if ( sdi2_38.getDuplicationsSum() != 5 ) {
1042             //                return false;
1043             //            }
1044             //            if ( sdi2_38.getSpeciationOrDuplicationEventsSum() != 0 ) {
1045             //                return false;
1046             //            }
1047             //            if ( sdi2_38.getSpeciationsSum() != 0 ) {
1048             //                return false;
1049             //            }
1050             //            final Phylogeny g2_100 = TestGSDI
1051             //                    .createPhylogeny( "(((e1[&&NHX:S=e1],f2[&&NHX:S=f2]),(d3[&&NHX:S=d3],g4[&&NHX:S=g4])),(((a1[&&NHX:S=a1],h2[&&NHX:S=h2]),c3[&&NHX:S=c3]),(i4[&&NHX:S=i4],b1[&&NHX:S=b1])))" );
1052             //            final GSDI sdi2_100 = new GSDI( g2_100, s2, false );
1053             //            if ( sdi2_100.getDuplicationsSum() != 4 ) {
1054             //                return false;
1055             //            }
1056             //            if ( sdi2_100.getSpeciationOrDuplicationEventsSum() != 0 ) {
1057             //                return false;
1058             //            }
1059             //            if ( sdi2_100.getSpeciationsSum() != 4 ) {
1060             //                return false;
1061             //            }
1062             //            if ( !TestGSDI.getEvent( g2_100, "e1", "f2" ).isSpeciation() ) {
1063             //                return false;
1064             //            }
1065             //            if ( !TestGSDI.getEvent( g2_100, "d3", "g4" ).isSpeciation() ) {
1066             //                return false;
1067             //            }
1068             //            if ( !TestGSDI.getEvent( g2_100, "e1", "d3" ).isDuplication() ) {
1069             //                return false;
1070             //            }
1071             //            if ( !TestGSDI.getEvent( g2_100, "a1", "h2" ).isSpeciation() ) {
1072             //                return false;
1073             //            }
1074             //            if ( !TestGSDI.getEvent( g2_100, "a1", "c3" ).isDuplication() ) {
1075             //                return false;
1076             //            }
1077             //            if ( !TestGSDI.getEvent( g2_100, "i4", "b1" ).isSpeciation() ) {
1078             //                return false;
1079             //            }
1080             //            if ( !TestGSDI.getEvent( g2_100, "a1", "i4" ).isDuplication() ) {
1081             //                return false;
1082             //            }
1083             //            if ( !TestGSDI.getEvent( g2_100, "e1", "a1" ).isDuplication() ) {
1084             //                return false;
1085             //            }
1086             //            final Phylogeny g2_101 = TestGSDI
1087             //                    .createPhylogeny( "(((e1[&&NHX:S=e1],f2[&&NHX:S=f2]),(d3[&&NHX:S=d3],g4[&&NHX:S=g4])),(((a1[&&NHX:S=a1],b2[&&NHX:S=b2]),c3[&&NHX:S=c3]),(i4[&&NHX:S=i4],j1[&&NHX:S=j1])))" );
1088             //            final GSDI sdi2_101 = new GSDI( g2_101, s2, false );
1089             //            if ( sdi2_101.getDuplicationsSum() != 2 ) {
1090             //                return false;
1091             //            }
1092             //            if ( sdi2_101.getSpeciationOrDuplicationEventsSum() != 1 ) {
1093             //                return false;
1094             //            }
1095             //            if ( sdi2_101.getSpeciationsSum() != 5 ) {
1096             //                return false;
1097             //            }
1098             //            if ( !TestGSDI.getEvent( g2_101, "e1", "f2" ).isSpeciation() ) {
1099             //                return false;
1100             //            }
1101             //            if ( !TestGSDI.getEvent( g2_101, "d3", "g4" ).isSpeciation() ) {
1102             //                return false;
1103             //            }
1104             //            if ( !TestGSDI.getEvent( g2_101, "e1", "d3" ).isDuplication() ) {
1105             //                return false;
1106             //            }
1107             //            if ( !TestGSDI.getEvent( g2_101, "a1", "b2" ).isSpeciation() ) {
1108             //                return false;
1109             //            }
1110             //            if ( !TestGSDI.getEvent( g2_101, "a1", "c3" ).isSpeciationOrDuplication() ) {
1111             //                return false;
1112             //            }
1113             //            if ( !TestGSDI.getEvent( g2_101, "i4", "j1" ).isSpeciation() ) {
1114             //                return false;
1115             //            }
1116             //            if ( !TestGSDI.getEvent( g2_101, "a1", "i4" ).isSpeciation() ) {
1117             //                return false;
1118             //            }
1119             //            if ( !TestGSDI.getEvent( g2_101, "e1", "a1" ).isDuplication() ) {
1120             //                return false;
1121             //            }
1122             //            final Phylogeny s_7_4 = DevelopmentTools.createBalancedPhylogeny( 7, 4 );
1123             //            DevelopmentTools.numberSpeciesInOrder( s_7_4 );
1124             //            final Phylogeny g_7_4_1 = TestGSDI
1125             //                    .createPhylogeny( "(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((("
1126             //                            + "1[&&NHX:S=1],2[&&NHX:S=2]),3[&&NHX:S=3]),4[&&NHX:S=4]),5[&&NHX:S=5]),"
1127             //                            + "6[&&NHX:S=6]),7[&&NHX:S=7]),8[&&NHX:S=8]),9[&&NHX:S=9]),10[&&NHX:S=10]),11[&&NHX:S=11]),"
1128             //                            + "12[&&NHX:S=12]),13[&&NHX:S=13]),14[&&NHX:S=14]),15[&&NHX:S=15]),16[&&NHX:S=16]),17[&&NHX:S=17]),"
1129             //                            + "18[&&NHX:S=18]),19[&&NHX:S=19]),20[&&NHX:S=20]),21[&&NHX:S=21]),22[&&NHX:S=22]),23[&&NHX:S=23]),"
1130             //                            + "24[&&NHX:S=24]),25[&&NHX:S=25]),26[&&NHX:S=26]),27[&&NHX:S=27]),28[&&NHX:S=28]),29[&&NHX:S=29]),"
1131             //                            + "30[&&NHX:S=30]),31[&&NHX:S=31]),32[&&NHX:S=32]),33[&&NHX:S=33]),34[&&NHX:S=34]),35[&&NHX:S=35]),"
1132             //                            + "36[&&NHX:S=36]),37[&&NHX:S=37]),38[&&NHX:S=38]),39[&&NHX:S=39]),40[&&NHX:S=40]),41[&&NHX:S=41]),"
1133             //                            + "42[&&NHX:S=42]),43[&&NHX:S=43]),44[&&NHX:S=44]),45[&&NHX:S=45]),46[&&NHX:S=46]),47[&&NHX:S=47]),"
1134             //                            + "48[&&NHX:S=48]),49[&&NHX:S=49]),50[&&NHX:S=50]),51[&&NHX:S=51]),52[&&NHX:S=52]),53[&&NHX:S=53]),"
1135             //                            + "54[&&NHX:S=54]),55[&&NHX:S=55]),56[&&NHX:S=56]),57[&&NHX:S=57]),58[&&NHX:S=58]),59[&&NHX:S=59]),"
1136             //                            + "60[&&NHX:S=60]),61[&&NHX:S=61]),62[&&NHX:S=62]),63[&&NHX:S=63]),64[&&NHX:S=64]),65[&&NHX:S=65])" );
1137             //            final GSDI sdi7_4_1 = new GSDI( g_7_4_1, s_7_4, false );
1138             //            if ( sdi7_4_1.getDuplicationsSum() != 54 ) {
1139             //                return false;
1140             //            }
1141             //            if ( sdi7_4_1.getSpeciationOrDuplicationEventsSum() != 6 ) {
1142             //                return false;
1143             //            }
1144             //            if ( sdi7_4_1.getSpeciationsSum() != 4 ) {
1145             //                return false;
1146             //            }
1147             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "2" ).isSpeciation() ) {
1148             //                return false;
1149             //            }
1150             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "3" ).isSpeciationOrDuplication() ) {
1151             //                return false;
1152             //            }
1153             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "4" ).isSpeciationOrDuplication() ) {
1154             //                return false;
1155             //            }
1156             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "5" ).isSpeciation() ) {
1157             //                return false;
1158             //            }
1159             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "6" ).isDuplication() ) {
1160             //                return false;
1161             //            }
1162             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "9" ).isSpeciationOrDuplication() ) {
1163             //                return false;
1164             //            }
1165             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "13" ).isSpeciationOrDuplication() ) {
1166             //                return false;
1167             //            }
1168             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "17" ).isSpeciation() ) {
1169             //                return false;
1170             //            }
1171             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "33" ).isSpeciationOrDuplication() ) {
1172             //                return false;
1173             //            }
1174             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "49" ).isSpeciationOrDuplication() ) {
1175             //                return false;
1176             //            }
1177             //            if ( !TestGSDI.getEvent( g_7_4_1, "1", "65" ).isSpeciation() ) {
1178             //                return false;
1179             //            }
1180             //            final Phylogeny g_7_4_2 = TestGSDI
1181             //                    .createPhylogeny( "((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((("
1182             //                            + "1[&&NHX:S=1],2[&&NHX:S=2]),3[&&NHX:S=3]),4[&&NHX:S=4]),5[&&NHX:S=5]),"
1183             //                            + "6[&&NHX:S=6]),7[&&NHX:S=7]),8[&&NHX:S=8]),9[&&NHX:S=9]),10[&&NHX:S=10]),11[&&NHX:S=11]),"
1184             //                            + "12[&&NHX:S=12]),13[&&NHX:S=13]),14[&&NHX:S=14]),15[&&NHX:S=15]),16[&&NHX:S=16]),17[&&NHX:S=17]),"
1185             //                            + "18[&&NHX:S=18]),19[&&NHX:S=19]),20[&&NHX:S=20]),21[&&NHX:S=21]),22[&&NHX:S=22]),23[&&NHX:S=23]),"
1186             //                            + "24[&&NHX:S=24]),25[&&NHX:S=25]),26[&&NHX:S=26]),27[&&NHX:S=27]),28[&&NHX:S=28]),29[&&NHX:S=29]),"
1187             //                            + "30[&&NHX:S=30]),31[&&NHX:S=31]),32[&&NHX:S=32]),33[&&NHX:S=33]),34[&&NHX:S=34]),35[&&NHX:S=35]),"
1188             //                            + "36[&&NHX:S=36]),37[&&NHX:S=37]),38[&&NHX:S=38]),39[&&NHX:S=39]),40[&&NHX:S=40]),41[&&NHX:S=41]),"
1189             //                            + "42[&&NHX:S=42]),43[&&NHX:S=43]),44[&&NHX:S=44]),45[&&NHX:S=45]),46[&&NHX:S=46]),47[&&NHX:S=47]),"
1190             //                            + "48[&&NHX:S=48]),49[&&NHX:S=49]),50[&&NHX:S=50]),51[&&NHX:S=51]),52[&&NHX:S=52]),53[&&NHX:S=53]),"
1191             //                            + "54[&&NHX:S=54]),55[&&NHX:S=55]),56[&&NHX:S=56]),57[&&NHX:S=57]),58[&&NHX:S=58]),59[&&NHX:S=59]),"
1192             //                            + "60[&&NHX:S=60]),61[&&NHX:S=61]),62[&&NHX:S=62]),63[&&NHX:S=63]),64[&&NHX:S=64]),65[&&NHX:S=65]),"
1193             //                            + "66[&&NHX:S=66]),257[&&NHX:S=257]),258[&&NHX:S=258]),513[&&NHX:S=513]),514[&&NHX:S=514]),769[&&NHX:S=769]),770[&&NHX:S=770])" );
1194             //            final GSDI sdi7_4_2 = new GSDI( g_7_4_2, s_7_4, false );
1195             //            if ( sdi7_4_2.getDuplicationsSum() != 58 ) {
1196             //                return false;
1197             //            }
1198             //            if ( sdi7_4_2.getSpeciationOrDuplicationEventsSum() != 8 ) {
1199             //                return false;
1200             //            }
1201             //            if ( sdi7_4_2.getSpeciationsSum() != 5 ) {
1202             //                return false;
1203             //            }
1204             //---------------------
1205             //             final String g2_0_ =
1206             //             "(([&&NHX:S=a1],[&&NHX:S=a2]),([&&NHX:S=o2],[&&NHX:S=o4]))";
1207             //             final Phylogeny g2_0 = factory.create( g2_0_, new NHXParser() )[
1208             //             0 ];
1209             //             g2_0.setRooted( true );
1210             //             final GSDI sdi2_0 = new GSDI( g2_0, s2, false );
1211             //             if ( sdi2_0.getDuplicationsSum() != 0 ) {
1212             //             return false;
1213             //             }
1214             //             final String g2_1_= "";
1215             //             final Phylogeny g2_1 = factory.create( g2_1_, new NHXParser() )[
1216             //             0 ];
1217             //             g2_1.setRooted( true );
1218             //             final GSDI sdi2_1 = new GSDI( g2_1, s2, false );
1219             //             if ( sdi2_1.getDuplicationsSum() != 0 ) {
1220             //             return false;
1221             //             }
1222         }
1223         catch ( final Exception e ) {
1224             e.printStackTrace( System.out );
1225             return false;
1226         }
1227         return true;
1228     }
1229
1230     public static void main( final String[] args ) {
1231         if ( !TestGSDI.testGSDI_against_binary_gene_tree() ) {
1232             System.out.println( "binary failed" );
1233         }
1234         if ( !TestGSDI.testGSDI_general() ) {
1235             System.out.println( "general failed" );
1236         }
1237         else {
1238             System.out.println( "general OK" );
1239         }
1240         //        boolean success = test();
1241         //        if ( success ) {
1242         //            System.out.println( "OK" );
1243         //        }
1244         //        else {
1245         //            System.out.println( "failed" );
1246         //        }
1247     }
1248 }