Optimization methods for the verification of second order sufficient conditions for bang–bang controls