Transform the beanName in method DefaultListableBeanFactory.isPrimary. Add the corresponding test cases. Fixes #22675.