I need to be able to disable the "Duplicate Class" error and the visual indicator (red, reddish underline) that you will get when you have two classes that are named the same in the same package, but in different folders. In this case, "main" and "test".
Background
It can be argued that this is a duplicate of this publication, but I thought that some background would be to avoid some obvious answers (and also, there is no satisfactory answer to this post).
This question is related to unit testing and a co-cell. As everyone knows, Android violates the basic "containment over inheritance" rule for Java development. That's why you need Robolectric to test lifecycle overrides without a framework that breaks your tests. Your collaborator cannot be mocked and introduced in the usual way, because the class being tested is a collaborator.
In this case, my large corporate client violated the “containment over inheritance” even more by adding several levels of class extensions from “Activity” and “Snippets” that should be used instead. I cannot modify these layers, and trying to trick the insides is impractical. The simplest solution was to duplicate the sheet classes of this extra layer, which provide test-compatible results for the test class.
It works. When you run unit tests, test duplicate is allowed, and when you run production code, production duplicate is allowed.
It is simply this constant annoying mistake that needs to be suppressed.
Workarounds, IntelliJ plugins, custom class loaders, etc. - everything will be reviewed (with instructions).