File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed
main/java/org/biojava/nbio/ontology
test/java/org/biojava/nbio/ontology Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -48,23 +48,7 @@ public String toString(){
4848 public final static Comparator <Synonym > COMPARATOR = new Comparator <Synonym >() {
4949 @ Override
5050 public int compare (Synonym a , Synonym b ) {
51- if (a == null && b == null )
52- return 0 ;
53- else if (a == null )
54- return -1 ;
55- else if (b == null )
56- return 1 ;
57- else {
58- if ((a .getCategory () == null ) && (b .getCategory () == null ))
59- return 0 ;
60- else if ( a .getCategory ()==null )
61- return -1 ;
62- else if ( b .getCategory ()==null )
63- return 1 ;
64-
65- return a .getCategory ().compareToIgnoreCase (
66- b .getCategory ());
67- }
51+ return String .CASE_INSENSITIVE_ORDER .compare (a .toString (), b .toString ());
6852 }
6953 };
7054
Original file line number Diff line number Diff line change @@ -80,6 +80,14 @@ public void testParsingHPOOBO() throws Exception {
8080 Assert .assertTrue (anno .containsProperty ("replaced_by" ));
8181 Assert .assertEquals ("HP:0008665" , anno .getProperty ("replaced_by" ));
8282 }
83+ if (term .getName ().equals ("HP:0000006" )) {
84+ Assert .assertEquals ("Autosomal dominant inheritance" , term .getDescription ());
85+ Object [] syns = term .getSynonyms ();
86+ Assert .assertEquals (3 , syns .length );
87+ Assert .assertEquals ("Autosomal dominant" , ((Synonym ) syns [0 ]).getName ());
88+ Assert .assertEquals ("Autosomal dominant form" , ((Synonym ) syns [1 ]).getName ());
89+ Assert .assertEquals ("Autosomal dominant type" , ((Synonym ) syns [2 ]).getName ());
90+ }
8391 }
8492 }
8593
You can’t perform that action at this time.
0 commit comments