public static Tree enclosingOfKind(final TreePath path,final Tree.Kind kind){
  return enclosingOfKind(path,EnumSet.of(kind));
}

public static Tree enclosingOfKind ( final TreePath path , final Tree . Kind kind ) { return enclosingOfKind ( path , EnumSet . of ( kind ) ) ; }
gets the first enclosing tree in path , of the specified kind .
