Testing the Code That Only Runs in Production
A guard that only matters in Production can't be covered by an Apex test, since tests always run in the org that launched them. System.DomainParser plus a @TestVisible override make that guard testable without an extra SOQL query. [...]