public static Node getEnclosingType ( Node n , final Token type ) { return getEnclosingNode ( n , new Predicate < Node > ( ) { @ Override public boolean apply ( Node n ) { return n . getToken ( ) == type ; } } ) ; }
Gets the closest ancestor to the given node of the provided type .