JAL-3438 spotless for 2.11.2.0
[jalview.git] / test / jalview / util / DBRefUtilsTest.java
index f92e454..d4574c0 100644 (file)
@@ -63,7 +63,9 @@ public class DBRefUtilsTest
     DBRefEntry ref2 = new DBRefEntry("UNIPROT", "1.2", "A12346");
     // Source is converted to upper-case by this constructor!
     DBRefEntry ref3 = new DBRefEntry("Uniprot", "1.2", "A12347");
-    List<DBRefEntry> dbrefs = Arrays.asList(new DBRefEntry[] { ref1, ref2, ref3 });
+    List<DBRefEntry> dbrefs = Arrays
+            .asList(new DBRefEntry[]
+            { ref1, ref2, ref3 });
     String[] sources = new String[] { "EMBL", "UNIPROT" };
 
     List<DBRefEntry> selected = DBRefUtils.selectRefs(dbrefs, sources);
@@ -108,10 +110,12 @@ public class DBRefUtilsTest
     assertEquals("PDB", DBRefUtils.getCanonicalName("Pdb"));
     assertEquals("UNIPROT",
             DBRefUtils.getCanonicalName("uniprotkb/swiss-prot"));
-    assertEquals("UNIPROT", DBRefUtils.getCanonicalName("uniprotkb/trembl"));
+    assertEquals("UNIPROT",
+            DBRefUtils.getCanonicalName("uniprotkb/trembl"));
     assertEquals("UNIPROT",
             DBRefUtils.getCanonicalName("UNIPROTKB/SWISS-PROT"));
-    assertEquals("UNIPROT", DBRefUtils.getCanonicalName("UNIPROTKB/TREMBL"));
+    assertEquals("UNIPROT",
+            DBRefUtils.getCanonicalName("UNIPROTKB/TREMBL"));
     assertEquals("UNIPROTKB/SWISS-CHEESE",
             DBRefUtils.getCanonicalName("UNIPROTKB/SWISS-CHEESE"));
     assertEquals("ENSEMBL", DBRefUtils.getCanonicalName("Ensembl"));
@@ -121,6 +125,7 @@ public class DBRefUtilsTest
     assertEquals("pfam", DBRefUtils.getCanonicalName("pfam"));
 
   }
+
   /**
    * Test 'parsing' a DBRef - non PDB case
    */
@@ -187,12 +192,14 @@ public class DBRefUtilsTest
     DBRefEntry ref4 = new DBRefEntry("EMBLCDS", "1", "A1234"); // no match
     // ref5 matches although it has a mapping - ignored
     DBRefEntry ref5 = new DBRefEntry("EMBL", "1", "A1234");
-    ref5.setMap(new Mapping(new MapList(new int[] { 1, 1 }, new int[] { 1,
-        1 }, 1, 1)));
+    ref5.setMap(
+            new Mapping(new MapList(new int[]
+            { 1, 1 }, new int[] { 1, 1 }, 1, 1)));
 
-    List<DBRefEntry> matches = DBRefUtils.searchRefs(
-               Arrays.asList(new DBRefEntry[] {
-        ref1, ref2, ref3, ref4, ref5 }), target, DBRefUtils.SEARCH_MODE_FULL);
+    List<DBRefEntry> matches = DBRefUtils
+            .searchRefs(Arrays.asList(new DBRefEntry[]
+            { ref1, ref2, ref3, ref4, ref5 }), target,
+                    DBRefUtils.SEARCH_MODE_FULL);
     assertEquals(3, matches.size());
     assertSame(ref1, matches.get(0));
     assertSame(ref2, matches.get(1));
@@ -207,26 +214,29 @@ public class DBRefUtilsTest
   public void testSearchRefs_withMapping()
   {
     DBRefEntry target = new DBRefEntry("EMBL", "2", "A1234");
-    final Mapping map1 = new Mapping(new MapList(new int[] { 1, 1 },
-            new int[] { 1, 1 }, 1, 1));
+    final Mapping map1 = new Mapping(
+            new MapList(new int[]
+            { 1, 1 }, new int[] { 1, 1 }, 1, 1));
     target.setMap(map1);
 
     // these all match target iff mappings match
     DBRefEntry ref1 = new DBRefEntry("EMBL", "1", "A1234"); // no map: matches
     DBRefEntry ref2 = new DBRefEntry("EMBL", "1", "A1234"); // =map: matches
-    final Mapping map2 = new Mapping(new MapList(new int[] { 1, 1 },
-            new int[] { 1, 1 }, 1, 1));
+    final Mapping map2 = new Mapping(
+            new MapList(new int[]
+            { 1, 1 }, new int[] { 1, 1 }, 1, 1));
     ref2.setMap(map2);
 
     // different map: no match
     DBRefEntry ref3 = new DBRefEntry("EMBL", "1", "A1234");
-    final Mapping map3 = new Mapping(new MapList(new int[] { 1, 1 },
-            new int[] { 1, 1 }, 2, 2));
+    final Mapping map3 = new Mapping(
+            new MapList(new int[]
+            { 1, 1 }, new int[] { 1, 1 }, 2, 2));
     ref3.setMap(map3);
 
-    List<DBRefEntry> matches = DBRefUtils.searchRefs(
-               Arrays.asList(new DBRefEntry[] {
-        ref1, ref2, ref3 }), target, DBRefUtils.SEARCH_MODE_FULL);
+    List<DBRefEntry> matches = DBRefUtils
+            .searchRefs(Arrays.asList(new DBRefEntry[]
+            { ref1, ref2, ref3 }), target, DBRefUtils.SEARCH_MODE_FULL);
     assertEquals(2, matches.size());
     assertSame(ref1, matches.get(0));
     assertSame(ref2, matches.get(1));
@@ -247,11 +257,13 @@ public class DBRefUtilsTest
     DBRefEntry ref4 = new DBRefEntry("EMBLCDS", "1", "A1235"); // no match
     // ref5 matches although it has a mapping - ignored
     DBRefEntry ref5 = new DBRefEntry("EMBL", "1", "A1234");
-    ref5.setMap(new Mapping(new MapList(new int[] { 1, 1 }, new int[] { 1,
-        1 }, 1, 1)));
+    ref5.setMap(
+            new Mapping(new MapList(new int[]
+            { 1, 1 }, new int[] { 1, 1 }, 1, 1)));
 
-    List<DBRefEntry> dbrefs = Arrays.asList(new DBRefEntry[] {
-                ref1, ref2, ref3, ref4, ref5 });
+    List<DBRefEntry> dbrefs = Arrays
+            .asList(new DBRefEntry[]
+            { ref1, ref2, ref3, ref4, ref5 });
     List<DBRefEntry> matches = DBRefUtils.searchRefs(dbrefs, "A1234");
     assertEquals(3, matches.size());
     assertSame(ref1, matches.get(0));
@@ -276,12 +288,14 @@ public class DBRefUtilsTest
     DBRefEntry ref4 = new DBRefEntry("EMBLCDS", "1", "A1234"); // no match
     // ref5 matches although it has a mapping - ignored
     DBRefEntry ref5 = new DBRefEntry("EMBL", "1", "A1237");
-    ref5.setMap(new Mapping(new MapList(new int[] { 1, 1 }, new int[] { 1,
-        1 }, 1, 1)));
+    ref5.setMap(
+            new Mapping(new MapList(new int[]
+            { 1, 1 }, new int[] { 1, 1 }, 1, 1)));
 
-    List<DBRefEntry> matches = DBRefUtils.searchRefs(
-               Arrays.asList(new DBRefEntry[] {
-        ref1, ref2, ref3, ref4, ref5 }), target, DBRefUtils.SEARCH_MODE_FULL);
+    List<DBRefEntry> matches = DBRefUtils
+            .searchRefs(Arrays.asList(new DBRefEntry[]
+            { ref1, ref2, ref3, ref4, ref5 }), target,
+                    DBRefUtils.SEARCH_MODE_FULL);
     assertEquals(4, matches.size());
     assertSame(ref1, matches.get(0));
     assertSame(ref2, matches.get(1));