Context caching can have significant performance benefits if context
initialization is complex. Although the initialization of a Spring context
itself is typically very quick, some beans in a context — for example,
an embedded database or a LocalContainerEntityManagerFactoryBean for
working with JPA — may take several seconds to initialize. Hence it
often makes sense to perform that initialization only once per test suite or
Remove the context with the given key from the cache and explicitly
it if it is an instance of ConfigurableApplicationContext.
Generally speaking, this method should be called to properly evict
a context from the cache (e.g., due to a custom eviction policy) or if
the state of a singleton bean has been modified, potentially affecting
future interaction with the context.