Unit { public String[] getSortedClasses() { return classByAnnotatorId.values().toArray(new String[0]); } Unit(UnitLocation location);  Unit(UnitLocation location, String annotatorId, String annotatorClass); UnitLocation getLocation(); URI getDocumentURI(); int getBegin(); int getEnd(); SortedMap<String, String> getClassesByAnnotatorId(); String[] getSortedClasses(); void putClassByAnnotatorId(String annotatorId, String annotatorClass); @Override String toString();  }
@Test public void testGetSortedClasses() throws URISyntaxException { Unit unit = new Unit(new UnitLocation(new URI("1"), 10, 15), "vasya", "cat"); assertArrayEquals(new String[]{"cat"}, unit.getSortedClasses()); unit.putClassByAnnotatorId("petya", "dog"); assertArrayEquals(new String[]{"dog", "cat"}, unit.getSortedClasses()); unit.putClassByAnnotatorId("sasha", "bird"); assertArrayEquals(new String[]{"dog", "bird", "cat"}, unit.getSortedClasses()); }