### Question:
EgovObjectUtil { public static Object instantiate(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception { Class<?> clazz; try { clazz = loadClass(className); return clazz.newInstance(); } catch (ClassNotFoundException e) { if (log.isErrorEnabled()) log.error(className + " : Class is can not instantialized."); throw new ClassNotFoundException(); } catch (InstantiationException e) { if (log.isErrorEnabled()) log.error(className + " : Class is can not instantialized."); throw new InstantiationException(); } catch (IllegalAccessException e) { if (log.isErrorEnabled()) log.error(className + " : Class is not accessed."); throw new IllegalAccessException(); } catch (Exception e) { if (log.isErrorEnabled()) log.error(className + " : Class is not accessed."); throw new Exception(e); } } private  EgovObjectUtil(); static Class<?> loadClass(String className); static Object instantiate(String className); static Object instantiate(String className, String[] types,
            Object[] values); static boolean isNull(Object object);  }### Answer:
@Test public void testInstantiate() throws Exception { String className = "java.lang.String"; String wrongClassName = "java.lang.String1"; String staticClassName = "egovframework.rte.fdl.string.EgovStringUtil"; Object object = EgovObjectUtil.instantiate(className); assertNotNull(object); String string = (String) object; string = "eGovFramework"; assertEquals("Framework", string.substring(4)); object = null; assertNull(object); Class<Exception> exceptionClass = null; try { object = EgovObjectUtil.instantiate(wrongClassName); } catch (Exception e) { log.error("### Exception : " + e.toString()); exceptionClass = (Class<Exception>) e.getClass(); } finally { assertEquals(ClassNotFoundException.class, exceptionClass); assertNotSame(InstantiationException.class, exceptionClass); assertNotSame(IllegalAccessException.class, exceptionClass); } }
@Test public void testInstantiateParamConstructor() throws Exception { String className = "java.lang.StringBuffer"; String[] types = new String[]{"java.lang.String"}; Object[] values = new Object[]{"전자정부 공통서비스"}; StringBuffer sb = (StringBuffer)EgovObjectUtil.instantiate(className, types, values); sb.append(" 및 개발프레임워크 구축 사업"); assertEquals("전자정부 공통서비스 및 개발프레임워크 구축 사업", sb.toString()); log.debug(sb.toString()); }