private boolean isTreeSymbolEffectivelyFinalOrUnmodifiable(Tree tree){
  Element elem=InternalUtils.symbol(tree);
  ElementKind ek=elem.getKind();
  return ek == ElementKind.PACKAGE || ek == ElementKind.CLASS || ek == ElementKind.METHOD || ElementUtils.isEffectivelyFinal(elem);
}

private boolean isTreeSymbolEffectivelyFinalOrUnmodifiable ( Tree tree ) { Element elem = InternalUtils . symbol ( tree ) ; ElementKind ek = elem . getKind ( ) ; return ek == ElementKind . PACKAGE || ek == ElementKind . CLASS || ek == ElementKind . METHOD || ElementUtils . isEffectivelyFinal ( elem ) ; }
returns true if the symbol for the given tree is final or effectively final . package , class and method symbols are unmodifiable and therefore considered final .
