Yup, your absolutely right - it is not relevant here, next time please ask questions like this on stackoverflow stackoverflow
But since I'm already here, you can use checkstyle for that, just outlaw imports you do not want, or expressions themselves. You can easily customize checkstyle rules. This is if you want to get rid of them in Java.
For Kotlin, you'll have to use something like deteKt
In IntelliJ you can also configure an inspection.