public Set<AnnotationClass> getClasses(int from, int to) {
        if(from < this.from || to > this.to) {
            throw new RuntimeException("Trying to get a range that is outside this span");
        }
        if (this.parent != null) {
            return parent.getClasses(from, to);
        } else {
            HashSet<AnnotationClass> classes = new HashSet<>();
            getAnnotationClasses(from, to, classes);
            return classes;
        }
    }
Returns all AnnotationClasses that are defined for the range (from,to).

@throws RuntimeException if (from, to) is not contained in the span
container-search/src/main/java/com/yahoo/text/interpretation/Span.java