I need tips on how to avoid sweets when you have to be in the same room as them for a long time.

In Jazz class, the teacher always has sweets and its hard to say no when the table is right next to the piano (where i have to sit) for the entire class period. Any tips on how to tell myself to say no?