The theory of convex optimization has been constantly developing over the past 30 years. Most recently, many researchers have been studying more complicated classes of problems that still can be studied by means of convex analysis, so-called "anticonvex" and "convex-anticonvex" optimizaton problems. This manuscript contains an exhaustive presentation of the duality for these classes of problems and some of its generalization in the framework of abstract convexity. This manuscript will be of great interest for experts in this and related fields.