I've created some test cases to demonstrate the problem : the test that use a custom with @AliasFor on @Import fails (customizersForClassesWithDifferentAliasedImportsAreNotEqual), whereas those with a direct use of @Import or use through a custom annotation with a hard coded @Import pass.

Comment From: snicoll

Thanks for the report. ContextCustomizerKey does not use MergedAnnoation and friends so it does not support aliasing at all.

Comment From: lmartelli

I may have some time to work on a PR for this. Just to be sure, the requirement for equality is that 2 ContextCustomizerKey should be equal if and only if their testClass have the same annotations, ignoring a set of annotations (JavaLang, Kotlin, Junit and Spock). Am I correct ?

Comment From: lmartelli

There is this DeterminableImports thing to take into account also ...

Comment From: wilkinsona

Closing in favor of #34917.