PR for #22060 (SPR-17528)

Comment From: snicoll

@rahulsh1 the discussion on the actual feature can happen on Jira but please make sure to add tests to exercise the code you've added.

Comment From: rahulsh1

@snicoll added tests

Comment From: jhoeller

We intend to make progress on #22060 in 6.0 indeed, and this PR is great input for that. It looks like we'll do a broader revision of DefaultListableBeanFactory internals in 6.0, superseding this PR with similar changes in the core implementation itself. Thanks for the pull request, in any case!