Issue #2795579 by martin107, klausi, dawehner: Adapt assertCacheContexts to not rely on the return value of assertIdentical (cherry picked from commit 52f2a292)