Is it possible to disable duplicate code detection in Intellij?
Add a hint to your code so that others will know your intent:
@SuppressWarnings("Duplicates")
Only available in IntelliJ Ultimate:
To disable duplicate code detection, go to
File → Settings → Editor → Inspections → General → Duplicated code fragment
and uncheck box "Duplicate code fragment".