There is an existing software project, developed and maintained by several developers. The IDE is IntelliJ, the build tool is Maven. The project has had both JUnit 4 and JUnit 5 tests. We want to refactor and use only JUnit 5 from now.
The problem is that code completion from the IDE still offers both JUnit 4 and JUnit 5, and devs might accidentally use them, e.g. org.junit.Assert.assertTrue instead of org.junit.jupiter.api.Assertions.assertTrue.
Is there an elegant, automated way to detect the use of JUnit 4 classes as early as possible?