/** Finds all block comments and associates them with their containing type. */
 private void findBlockComments(CompilationUnit unit, List<AbstractTypeDeclaration> types) {
   List<Comment> comments = ASTUtil.getCommentList(unit);
   for (Comment comment : comments) {
     if (!comment.isBlockComment()) {
       continue;
     }
     int commentPos = comment.getStartPosition();
     AbstractTypeDeclaration containingType = null;
     int containingTypePos = -1;
     for (AbstractTypeDeclaration type : types) {
       int typePos = type.getStartPosition();
       if (typePos < 0) {
         continue;
       }
       int typeEnd = typePos + type.getLength();
       if (commentPos > typePos && commentPos < typeEnd && typePos > containingTypePos) {
         containingType = type;
         containingTypePos = typePos;
       }
     }
     if (containingType != null) {
       blockComments.put(containingType, comment);
     }
   }
 }