ContextAnalyzer { public boolean areThereExportsWithoutImport() { boolean allExportshaveImports = true; for (String exportedBeanName : exports.keySet()) { if (!imports.containsKey(exportedBeanName)) { allExportshaveImports = false; log.warn("Bean {} was exported but never imported", exportedBeanName); } } return allExportshaveImports; }  Map<String, List<BeanReferenceInfo>> getImports(); void addImport(BeanDefinition beanDefinition, String location); Map<String, BeanReferenceInfo> getExports(); void addExport(BeanDefinition beanDefinition, String location); boolean areThereImportsWithoutExports(); boolean areThereExportsWithoutImport(); boolean areImportsTypesCorrect(); void putInImports(BeanReferenceInfo importRefInfo); void putInExports(BeanReferenceInfo exportRefInfo);  }
@Test public void areThereExportsWithoutImport() { ContextAnalyzer analyzer = new ContextAnalyzer(); String beanName = "firstObject"; BeanReferenceInfo exportRef = new BeanReferenceInfo(); exportRef.setBeanName(beanName); analyzer.putInExports(exportRef); assertFalse(analyzer.areThereExportsWithoutImport()); BeanReferenceInfo importRef1 = new BeanReferenceInfo(); importRef1.setBeanName(beanName); analyzer.putInImports(importRef1); assertTrue(analyzer.areThereExportsWithoutImport()); }