An IDE underlines an import in red, the developer is confident the class exists, and `mvn test` from the terminal builds clean with no errors. What's actually out of sync, and what's the right fix versus the tempting wrong one?
The build succeeding proves the class genuinely exists on the real classpath, so the red squiggly isn't a real compile error — it's the IDE's own index reporting what its parser currently believes, and that belief has fallen behind the actual build configuration (most often because a dependency changed and the IDE was never told to re-sync). The right fix is making the IDE re-derive its index from the real build file — reimport the project, or the equivalent "reload changes" action. The wrong fix is editing the working import, deleting and retyping it, or otherwise changing code that already compiles correctly just to satisfy a stale cached opinion — that treats the IDE's index as more authoritative than the build that actually produces the artifact, when it's the other way around.