I can think of at least three different 'environments' for my code:
installed, in a customer org,
unmanaged, in a cloned dev org,
managed, in the packaging org,
The first case can be covered by UserInfo.isCurrentUserLicensed('ns')
The second case can be covered by SObjectType.KnownObject__c.Name.startsWith('ns__')
But I'm actually struggling to differentiate the second and third case! Any ideas?
