SequenceItem { public static List<SequenceItem> of(String... aLabels) { return of(1, aLabels); } SequenceItem(int aBegin, int aEnd, String aLabel); int getBegin(); int getEnd(); String getLabel(); @Override String toString(); static List<SequenceItem> of(String... aLabels); static List<SequenceItem> of(int aOffset, String... aLabels); @Override boolean equals(final Object other); @Override int hashCode();  }
@Test public void testSpanSequenceConstructionWithDefaultOffset() { List<SequenceItem> sequence = SequenceItem.of("O", "B-PER", "I-PER", "O"); assertThat(sequence).containsExactly( new SequenceItem(1, 1, "O"), new SequenceItem(2, 2, "B-PER"), new SequenceItem(3, 3, "I-PER"), new SequenceItem(4, 4, "O")); }
@Test public void testSpanSequenceConstructionWithExplicitOffset() { List<SequenceItem> sequence = SequenceItem.of(0, "O", "B-PER", "I-PER", "O"); assertThat(sequence).containsExactly( new SequenceItem(0, 0, "O"), new SequenceItem(1, 1, "B-PER"), new SequenceItem(2, 2, "I-PER"), new SequenceItem(3, 3, "O")); }