JAL-4313 Create utilities to test annotations
[jalview.git] / test / jalview / testutils / Matchers.java
1 package jalview.testutils;
2
3 import java.util.Arrays;
4 import java.util.List;
5
6 import org.hamcrest.Matcher;
7
8 import jalview.datamodel.Annotation;
9 import jalview.datamodel.SequenceI;
10
11 public class Matchers
12 {
13   public static Matcher<SequenceI> matchesSequenceString(String sequence)
14   {
15     return new SequenceStringMatcher(sequence);
16   }
17
18   public static Matcher<SequenceI> matchesSequenceString(SequenceI sequence)
19   {
20     return new SequenceStringMatcher(sequence.getSequenceAsString());
21   }
22
23   public static Matcher<Annotation[]> matchesAnnotations(
24       List<Annotation> annotations)
25   {
26     return new AnnotationsMatcher(annotations);
27   }
28
29   public static Matcher<Annotation[]> matchesAnnotations(
30       Annotation... annotations)
31   {
32     return new AnnotationsMatcher(Arrays.asList(annotations));
33   }
34 }