finds the corresponding functional interface method for a lambda expression or method reference

@param tree the lambda expression or method reference
@return the functional interface method
189447
public static Symbol.MethodSymbol getFunctionalInterfaceMethod(ExpressionTree tree, Types types) {
    Preconditions.checkArgument(
        (tree instanceof LambdaExpressionTree) || (tree instanceof MemberReferenceTree));
    Type funcInterfaceType = ((JCTree.JCFunctionalExpression) tree).type;
    return (Symbol.MethodSymbol) types.findDescriptorSymbol(funcInterfaceType.tsym);
  }
576693
protected synchronized void fireTreeAddition(Tree<D, ?> tree) {
		if (this.listeners != null) {
			final ForestListener[] list = new ForestListener[this.listeners.size()];
			this.listeners.toArray(list);
			final ForestEvent event = new ForestEvent(this, null, tree);
			for (final ForestListener listener : list) {
				listener.forestChanged(event);
			}
		}
	}
78151
public void visitApply(JCMethodInvocation tree) {
            if (TreeInfo.name(tree.meth) == names._super) {
                Symbol constructor = TreeInfo.symbol(tree.meth);
                ClassSymbol c = (ClassSymbol)constructor.owner;
                if (c.hasOuterInstance() &&
                    !tree.meth.hasTag(SELECT) &&
                    outerThisStack.head != null)
                    visitSymbol(outerThisStack.head);
            }
            super.visitApply(tree);
        }
821224
private static ConjunctionImpl simpleConjunct(Selector tree) {
    if (tree.getNumIds() == 0)
    {
      Boolean theEval = (Boolean) Matching.getEvaluator().eval(tree);
      if (theEval != null && theEval.booleanValue()) // was ((BooleanValue) Matching.getEvaluator().eval(tree)).booleanValue()    	
        return new ConjunctionImpl();
      else
        return null;
    }
    else if (Matching.isSimple(tree))
    {
        if(tree.isExtended())
          return new ConjunctionImpl(new ExtendedSimpleTestImpl(tree));
        else
   	      return new ConjunctionImpl(new SimpleTestImpl(tree));
    }
    else
      return new ConjunctionImpl(tree);
  }
359131
private static Optional<Fix> linkedListFix(Tree tree, VisitorState state) {
    Type type = getTargetType(state);
    if (type == null) {
      return Optional.empty();
    }
    Types types = state.getTypes();
    for (String replacement : ImmutableList.of("java.util.ArrayList", "java.util.ArrayDeque")) {
      Symbol sym = state.getSymbolFromString(replacement);
      if (sym == null) {
        continue;
      }
      if (types.isAssignable(types.erasure(sym.asType()), types.erasure(type))) {
        SuggestedFix.Builder fix = SuggestedFix.builder();
        while (tree instanceof ParameterizedTypeTree) {
          tree = ((ParameterizedTypeTree) tree).getType();
        }
        fix.replace(tree, SuggestedFixes.qualifyType(state, fix, sym));
        return Optional.of(fix.build());
      }
    }
    return Optional.empty();
  }
222519
public static <T extends Tree> Matcher<T> isTransient() {
    return new Matcher<T>() {
      @Override
      public boolean matches(Tree tree, VisitorState state) {
        Symbol sym = ASTHelpers.getSymbol(tree);
        // NOTE(yorick): there is no isTransient() on Symbol. This is what it would be.
        return sym.getModifiers().contains(Modifier.TRANSIENT);
      }
    };
  }
63150
private static boolean mockitoInvocation(Tree tree, VisitorState state) {
    if (!(tree instanceof JCMethodInvocation)) {
      return false;
    }
    JCMethodInvocation invocation = (JCMethodInvocation) tree;
    if (!(invocation.getMethodSelect() instanceof JCFieldAccess)) {
      return false;
    }
    ExpressionTree receiver = ASTHelpers.getReceiver(invocation);
    return MOCKITO_MATCHER.matches(receiver, state);
  }
153275
@Nullable
  public static TreePath findEnclosingMethodOrLambdaOrInitializer(TreePath path) {
    TreePath curPath = path.getParentPath();
    while (curPath != null) {
      if (curPath.getLeaf() instanceof MethodTree
          || curPath.getLeaf() instanceof LambdaExpressionTree) {
        return curPath;
      }
      TreePath parent = curPath.getParentPath();
      if (parent != null && parent.getLeaf() instanceof ClassTree) {
        if (curPath.getLeaf() instanceof BlockTree) {
          // found initializer block
          return curPath;
        }
        if (curPath.getLeaf() instanceof VariableTree
            && ((VariableTree) curPath.getLeaf()).getInitializer() != null) {
          // found field with an inline initializer
          return curPath;
        }
      }
      curPath = parent;
    }
    return null;
  }
707383
@Override
  public Description matchMethod(MethodTree tree, VisitorState state) {
    MethodSymbol methodSym = ASTHelpers.getSymbol(tree);
    if (methodSym == null) {
      return Description.NO_MATCH;
    }

    // Allow abstract methods.
    if (methodSym.getModifiers().contains(Modifier.ABSTRACT)) {
      return Description.NO_MATCH;
    }

    String annotatedSuperMethod = null;
    String matchedAnnotationSimpleName = null;
    for (MethodSymbol method : ASTHelpers.findSuperMethods(methodSym, state.getTypes())) {
      for (AnnotationType annotationType : AnnotationType.values()) {
        if (ASTHelpers.hasAnnotation(method, annotationType.fullyQualifiedName(), state)) {
          annotatedSuperMethod = getMethodName(method);
          matchedAnnotationSimpleName = annotationType.simpleName();
          break;
        }
      }
    }

    if (annotatedSuperMethod == null || matchedAnnotationSimpleName == null) {
      return Description.NO_MATCH;
    }

    TreeScanner<Boolean, Void> findSuper = new FindSuperTreeScanner(tree.getName().toString());
    if (findSuper.scan(tree, null)) {
      return Description.NO_MATCH;
    }

    return buildDescription(tree)
        .setMessage(
            String.format(
                "This method overrides %s, which is annotated with @%s, but does not call the "
                    + "super method",
                annotatedSuperMethod, matchedAnnotationSimpleName))
        .build();
  }
761261
public void visitApply(JCMethodInvocation tree) {
            if (TreeInfo.name(tree.meth) == names._super) {
                addFreeVars((ClassSymbol) TreeInfo.symbol(tree.meth).owner);
            }
            super.visitApply(tree);
        }
429506
@Nullable
  public static Type getType(@Nullable Tree tree) {
    return tree instanceof JCTree ? ((JCTree) tree).type : null;
  }
1148043
@Nullable
  public static ClassType getType(@Nullable ClassTree tree) {
    Type type = getType((Tree) tree);
    return type instanceof ClassType ? (ClassType) type : null;
  }
1194628
protected Pool<BehaviorTree> getPool(final String treeReference){
		Pool<BehaviorTree> treePool = pools.get(treeReference);
		if(treePool == null){
			treePool = new Pool<BehaviorTree>(){
				@Override
				protected BehaviorTree newObject() {
					return newBehaviorTree(treeReference);
				}
			};
			pools.put(treeReference, treePool);
		}
		return treePool;
	}
1110765
@Override
    public <T extends JCTree> T translate(T tree) {
        TranslationContext<?> newContext = contextMap.get(tree);
        return translate(tree, newContext != null ? newContext : context);
    }
954867
@Override
  public Description matchMethod(MethodTree methodTree, VisitorState state) {
    SuggestedFix.Builder fix = null;
    if (isInjectedConstructor(methodTree, state)) {
      for (AnnotationTree annotationTree : methodTree.getModifiers().getAnnotations()) {
        if (OPTIONAL_INJECTION_MATCHER.matches(annotationTree, state)) {
          // Replace the annotation with "@Inject"
          if (fix == null) {
            fix = SuggestedFix.builder();
          }
          fix = fix.replace(annotationTree, "@Inject");
        } else if (BINDING_ANNOTATION_MATCHER.matches(annotationTree, state)) {
          // Remove the binding annotation
          if (fix == null) {
            fix = SuggestedFix.builder();
          }
          fix = fix.delete(annotationTree);
        }
      }
    }
    if (fix == null) {
      return Description.NO_MATCH;
    } else {
      return describeMatch(methodTree, fix.build());
    }
  }
520591
private Long storeTree(MtasTree<?> tree, IndexOutput out,
      long refApproxOffset) throws IOException {
    return storeTree(tree.close(), tree.isSinglePoint(),
        tree.isStorePrefixAndTermRef(), out, null, refApproxOffset);
  }
387505
@SuppressWarnings("unchecked")
    public <T extends TreeNode> TreeNode treeFrom(Object source)
            throws IOException, JSONObjectException
    {
        if (_treeCodec == null) {
             _noTreeCodec("read TreeNode");
        }
        if (source instanceof JsonParser) {
            JsonParser p = _initForReading((JsonParser) source);
            T result = (T) _treeCodec.readTree(p);
            p.clearCurrentToken();
            return result;
        }
        JsonParser p = _parser(source);
        try {
            _initForReading(_config(p));
            T result = (T) _treeCodec.readTree(p);
            JsonParser p0 = p;
            p = null;
            _close(p0, null);
            return result;
        } catch (Exception e) {
            _close(p, e);
            return null;
        }
    }