This is new version of method that I mentioned in my previous topics: 'Apex, check object by Id' and 'Apex, check object by Id. Update.'. Earlier, if Id.valueOf( objectIdString ) == null we had an error 'FATAL_ERROR System.StringException: Invalid id'. To avoid this error I use 'instanceof'. So now will not have any errors, even if we do not have such object in system like 'objectTypeNameString' or it will be null.