void (@NotNull Runnable check) { try { isDuplicatedCheckDisabled = true; failedDuplicationChecks = 0; check.run(); } finally { isDuplicatedCheckDisabled = false; } if (failedDuplicationChecks == 0) { throw new IllegalStateException(EXPECTED_DUPLICATION_MESSAGE); } }