### Question:
ReferenceAnnotationBeanPostProcessor extends InstantiationAwareBeanPostProcessorAdapter implements MergedBeanDefinitionPostProcessor, PriorityOrdered, ApplicationContextAware, BeanClassLoaderAware,
        DisposableBean { public Collection<ReferenceBean<?>> getReferenceBeans() { return this.referenceBeansCache.values(); }  @Override PropertyValues postProcessPropertyValues(
            PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName); @Override void setApplicationContext(ApplicationContext applicationContext); @Override void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName); @Override int getOrder(); @Override void destroy(); @Override void setBeanClassLoader(ClassLoader classLoader); Collection<ReferenceBean<?>> getReferenceBeans(); Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> getInjectedFieldReferenceBeanMap(); Map<InjectionMetadata.InjectedElement, ReferenceBean<?>> getInjectedMethodReferenceBeanMap(); static final String BEAN_NAME; }### Answer:
@Test public void testGetReferenceBeans() { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TestBean.class); ReferenceAnnotationBeanPostProcessor beanPostProcessor = context.getBean(BEAN_NAME, ReferenceAnnotationBeanPostProcessor.class); Collection<ReferenceBean<?>> referenceBeans = beanPostProcessor.getReferenceBeans(); Assertions.assertEquals(3, referenceBeans.size()); ReferenceBean<?> referenceBean = referenceBeans.iterator().next(); TestBean testBean = context.getBean(TestBean.class); Assertions.assertEquals(referenceBean.get(), testBean.getDemoServiceFromAncestor()); Assertions.assertEquals(referenceBean.get(), testBean.getDemoServiceFromParent()); Assertions.assertEquals(referenceBean.get(), testBean.getDemoService()); }