code: public static Matcher<ClassTree> nestingKind(final NestingKind kind) {
      return new Matcher<ClassTree>() {
        @Override
        public boolean matches(ClassTree classTree, VisitorState state) {
          ClassSymbol sym = ASTHelpers.getSymbol(classTree);
          return sym.getNestingKind() == kind;
        }
      };
    }
docs: Matches an class based on whether it is nested in another class or method.
  
  @param kind The kind of nesting to match, eg ANONYMOUS, LOCAL, MEMBER, TOP_LEVEL