JAL-4313 Patch AnnotationsMatcher to match nulls
[jalview.git] / test / jalview / testutils / AnnotationsMatcher.java
index aa86d90..cc64d27 100644 (file)
@@ -35,6 +35,10 @@ public class AnnotationsMatcher extends TypeSafeMatcher<Annotation[]>
 
   static boolean annotationsEqual(Annotation a, Annotation b)
   {
+    if (a == null && b == null)
+      return true;
+    if ((a == null) != (b == null)) // if one is null but the other is not
+      return false;
     return a.secondaryStructure == b.secondaryStructure && a.value == b.value
         && Objects.equals(a.colour, b.colour)
         && Objects