You can use: com.mendix.core.Core.getMode().toString()
Comparing with the enum is not possible anymore, since it is obfuscated. I think that is a bug, so if that is a problem, you might file a bug report.
the new code:
if ("DEVELOPMENT".equals(Core.getMode().toString()) || "TESTING".equals(Core.getMode().toString()))
AFAIK you should still be able to use this API, what's the problem exactly? Do you have trouble compiling?
Yes, I have trouble compiling since the package com.mendix.core.Core.Mode does not exists anymore in version 2.5