--- /dev/null
+package jalview.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.Test;
+
+public class ShiftListTest
+{
+
+ @Test
+ public void testParseMap()
+ {
+ assertNull(ShiftList.parseMap(null));
+ assertNull(ShiftList.parseMap(new int[]
+ {}));
+
+ /*
+ * Gap map showing residues in aligned positions 2,3,6,8,9,10,12
+ */
+ int[] gm = new int[]
+ { 2, 3, 6, 8, 9, 10, 12 };
+ List<int[]> shifts = ShiftList.parseMap(gm).getShifts();
+ assertEquals(4, shifts.size());
+
+ // TODO are these results (which pass) correct??
+ assertEquals("[0, 2]", Arrays.toString(shifts.get(0)));
+ assertEquals("[4, 2]", Arrays.toString(shifts.get(1)));
+ assertEquals("[7, 1]", Arrays.toString(shifts.get(2)));
+ assertEquals("[11, 1]", Arrays.toString(shifts.get(3)));
+ }
+}