Only law can change people's habits. Plastic cups example

Imagine someone telling you - plastic cups are forbidden in companies.
Yep. Coffee machine works only if you put your mug in. Crazy isn't it?
It happened in France.
Guess what. 
After a couple of wtf days, nobody really cares and get the habit to use mugs.
Imagine if a law has just "encouraged" this change.
People would have thought it was far too hard.
Only law can change people's habits.
I don't believe people - of course except a small percentage - can put constraints on them for civilization's survival.
You?