### Question:
LegacyPluginExtenderFactory { public Object create( String className ) throws ClassNotFoundException, InvocationTargetException, IllegalAccessException, InstantiationException { return create( className, null ); } LegacyPluginExtenderFactory( BundleContext bundleContext, String pluginType, String pluginId ); Object create( String className ); Object create( String className, List<Object> arguments );  }### Answer:
@Test public void testCreate() throws Exception { legacyPluginExtenderFactory = new LegacyPluginExtenderFactory( bundleContext, MockPluginType.class.getCanonicalName(), PLUGIN_ID ); MockPluginType result = (MockPluginType) legacyPluginExtenderFactory.create( MockPluginType.class.getName() ); assertNotNull( result ); assert( result.getClass().isAssignableFrom( MockPluginType.class )); }
@Test public void testCreate1() throws Exception { List argumentsList = new ArrayList(); argumentsList.add( PLUGIN_ID ); legacyPluginExtenderFactory = new LegacyPluginExtenderFactory( bundleContext, MockPluginType.class.getCanonicalName(), PLUGIN_ID ); MockPluginType result = (MockPluginType) legacyPluginExtenderFactory.create( MockPluginType.class.getName(), argumentsList ); assertNotNull( result ); assert( result.getClass().isAssignableFrom( MockPluginType.class )); }
@Test(expected=InstantiationException.class) public void testCreateInvalidArgument() throws Exception { List argumentsList = new ArrayList(); argumentsList.add( new Integer( 7 ) ); legacyPluginExtenderFactory = new LegacyPluginExtenderFactory( bundleContext, MockPluginType.class.getCanonicalName(), PLUGIN_ID ); MockPluginType result = (MockPluginType) legacyPluginExtenderFactory.create( MockPluginType.class.getName(), argumentsList ); }