I recently found that some strings, which are very much NOT Salesforce Ids, will cause instanceof Id to return a false positive.
Example:
String extId = '243209199570387970';
Boolean isId = extId instanceof Id;
System.debug(isId); // ouputs TRUE but should be false
Is this just simply a bug or is there some weird intended behavior in this? Are there any alternatives to checking if a String is a Salesforce ID?
001000000000000
or001000000000001
for different accountIds when unit testing methods that accept sobjects as args