code: @Nullable
    private static Symbol tryGetSymbol(Tree tree) {
      if (tree instanceof JCIdent) {
        return ((JCIdent) tree).sym;
      }
      if (tree instanceof JCFieldAccess) {
        return ((JCFieldAccess) tree).sym;
      }
      if (tree instanceof JCVariableDecl) {
        return ((JCVariableDecl) tree).sym;
      }
      return null;
    }
docs: /*
  We can't use ASTHelpers here. It's in core, which depends on jdk8, so we can't make jdk8 depend
  back on core.