### Question:
DependencyInjectionBeanFactory implements MyBeanFactory { @SuppressWarnings("unchecked") public <T> T getBean(Class<T> clazz) { return (T) injectionGraph.get(clazz); } DependencyInjectionBeanFactory();  DependencyInjectionBeanFactory(String packageName); @SuppressWarnings("unchecked") T getBean(Class<T> clazz); final String packageName; final Map<Class<?>, Object> injectionGraph; }### Answer:
@Test public void testLoadAreAllComponentsAreLoaded() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { instance = new DependencyInjectionBeanFactory("dependency_injection_with_annotations"); ClassWithAttributes myBean = instance.getBean(ClassWithAttributes.class); assertNotNull(myBean); assertNotNull(myBean.getInjectedClass()); }
@Test public void testLoadNoComponentsFound() throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException { instance = new DependencyInjectionBeanFactory("wibble"); ClassWithAttributes myBean = instance.getBean(ClassWithAttributes.class); assertNull(myBean); }