private Set<AnnotationMirror> findGreatestTypes(Set<AnnotationMirror> inset){
  Set<AnnotationMirror> outset=AnnotationUtils.createAnnotationSet();
  outset.addAll(inset);
  for (  AnnotationMirror a1 : inset) {
    Iterator<AnnotationMirror> outit=outset.iterator();
    while (outit.hasNext()) {
      AnnotationMirror a2=outit.next();
      if (a1 != a2 && isSubtype(a2,a1)) {
        outit.remove();
      }
    }
  }
  return outset;
}

private Set < AnnotationMirror > findGreatestTypes ( Set < AnnotationMirror > inset ) { Set < AnnotationMirror > outset = AnnotationUtils . createAnnotationSet ( ) ; outset . addAll ( inset ) ; for ( AnnotationMirror a1 : inset ) { Iterator < AnnotationMirror > outit = outset . iterator ( ) ; while ( outit . hasNext ( ) ) { AnnotationMirror a2 = outit . next ( ) ; if ( a1 != a2 && isSubtype ( a2 , a1 ) ) { outit . remove ( ) ; } } } return outset ; }
remove all subtypes of elements contained in the set .
