Tag implements Comparable<Tag>, Serializable { public Tag(String name, Map<String, String> attributes, int termBegin, int termEnd, int charBegin, int charEnd) { this.name = name; this.attributes = attributes; this.begin = termBegin; this.end = termEnd; this.charBegin = charBegin; this.charEnd = charEnd; } Tag(String name, Map<String, String> attributes, int termBegin, int termEnd, int charBegin, int charEnd);  Tag(String name, Map<String, String> attributes, int termBegin, int termEnd); @Override int compareTo(Tag other); @Override String toString(); public String name; public Map<String, String> attributes; public int begin; public int end; public int charBegin; public int charEnd; }
@Test public void testTag() { Tag t = new Tag("a", Collections.singletonMap("b", "c"), 0, 1); assertEquals("a", t.name); assertEquals(0, t.begin); assertEquals(1, t.end); assertTrue(t.attributes.containsKey("b")); assertEquals("c", t.attributes.get("b")); assertEquals(1, t.attributes.size()); }