There is a rule I would like to enforce in unit tests so that new code doesn't violate the rule. But I would like to just print warning out in production environment to allow production function regardless while I am cleaning it up.
I wonder if it's possible in Java to do the above in a clean way? Thanks!
I can think of a few approaches:
Most of these wouldn't give you the warning in production. But they wouldn't fail in production either.
What is best to do depends on what rule you are trying to check.