Return resourceId collection,  Process only last resource, when
duplicate