Higher order optimality conditions in nonsmooth optimization