### Question:
BeanFactory { public Object getBeanFactory(String beanId) throws Exception { Object obj = null; for (BeanDefined beanDefined : beanDefineds) { if (beanDefined.getBeanId().equals(beanId)) { String classPath = beanDefined.getClassPath(); Class<?> classFile = Class.forName(classPath); String scope = beanDefined.getScope(); String factoryBean = beanDefined.getFactoryBean(); String factoryMethod = beanDefined.getFactoryMethod(); if (scope.equals("prototype")) { if (factoryBean != null && factoryMethod != null) { Object oc = classFile.newInstance(); Method method = classFile.getDeclaredMethod(factoryMethod, null); method.setAccessible(true); obj = method.invoke(oc, null); } else { obj = classFile.newInstance(); } } else { Ioc.get(beanDefined.getBeanId()); } return obj; } } return obj; } BeanFactory(List<BeanDefined> beanDefineds); Object getBean(String beanId); Object getBeanScope(String beanId); Object getBeanFactory(String beanId);  }### Answer:
@Test public void beanTest03() throws Exception { BeanDefined bean01 = new BeanDefined(); bean01.setBeanId("teacher"); bean01.setClassPath("com.huifer.bean.TeacherFactory"); bean01.setFactoryBean("tFactory"); bean01.setFactoryMethod("createTeacher"); bean01.setScope("prototype"); List<BeanDefined> beanDefinedList = new ArrayList<BeanDefined>(); beanDefinedList.add(bean01); BeanFactory beanFactory = new BeanFactory(beanDefinedList); Teacher teacher1 = (Teacher) beanFactory.getBeanFactory("teacher"); System.out.println(teacher1); }