code: List<JCClassDecl> listClasses(List<JCCompilationUnit> trees) {
          ListBuffer<JCClassDecl> result = new ListBuffer<>();
          for (JCCompilationUnit t : trees) {
              for (JCTree def : t.defs) {
                  if (def.hasTag(JCTree.Tag.CLASSDEF))
                      result.append((JCClassDecl)def);
              }
          }
          return result.toList();
      }
docs: From a list of top level trees, return the list of contained class definitions