ContextAnalyzer { public boolean areThereImportsWithoutExports() { boolean allImportsHaveExports = false; for (String importedBeanName : imports.keySet()) { if (!exports.containsKey(importedBeanName)) { allImportsHaveExports = true; String location = imports.get(importedBeanName).get(0).getLocation(); log.error("Import without export was found. Bean: {} location: {}", importedBeanName, location); } } return allImportsHaveExports; }  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 areThereImportsWithoutExports() { ContextAnalyzer analyzer = new ContextAnalyzer(); String beanName = "firstObject"; BeanReferenceInfo importRef1 = new BeanReferenceInfo(); importRef1.setBeanName(beanName); analyzer.putInImports(importRef1); assertTrue(analyzer.areThereImportsWithoutExports()); BeanReferenceInfo exportRef = new BeanReferenceInfo(); exportRef.setBeanName(beanName); analyzer.putInExports(exportRef); assertFalse(analyzer.areThereImportsWithoutExports()); }