MergedClass { public static Constructor<?> getConstructor(ClassInjector injector, Class<?>[] classes) throws IllegalArgumentException { return getConstructor(injector, classes, null, null, OBSERVER_DISABLED); } private  MergedClass(); static Constructor<?> getConstructor(ClassInjector injector,
                                                Class<?>[] classes); static Constructor<?> getConstructor(ClassInjector injector,
                                                Class<?>[] classes,
                                                Class<?>[] interfaces); static Constructor<?> getConstructor(ClassInjector injector,
                                                Class<?>[] classes,
                                                String[] prefixes); static Constructor<?> getConstructor(ClassInjector injector,
                                                Class<?>[] classes,
                                                String[] prefixes,
                                                Class<?>[] interfaces); static Constructor<?> getConstructor(ClassInjector injector,
                                                Class<?>[] classes,
                                                String[] prefixes,
                                                int observerMode); static Constructor<?> getConstructor(ClassInjector injector,
                                                Class<?>[] classes,
                                                String[] prefixes,
                                                Class<?>[] interfaces,
                                                int observerMode); static Constructor<?> getConstructor2(ClassInjector injector,
                                                 Class<?>[] classes); static Constructor<?> getConstructor2(ClassInjector injector,
                                                 Class<?>[] classes,
                                                 Class<?>[] interfaces); static Constructor<?> getConstructor2(ClassInjector injector,
                                                 Class<?>[] classes,
                                                 String[] prefixes); static Constructor<?> getConstructor2(ClassInjector injector,
                                                 Class<?>[] classes,
                                                 String[] prefixes,
                                                 Class<?>[] interfaces); static Constructor<?> getConstructor2(ClassInjector injector,
                                                 Class<?>[] classes,
                                                 String[] prefixes,
                                                 int observerMode); static Constructor<?> getConstructor2(ClassInjector injector,
                                                 Class<?>[] classes,
                                                 String[] prefixes,
                                                 Class<?>[] interfaces,
                                                 int observerMode); static ClassFile buildClassFile(String className, Class<?>[] classes); static ClassFile buildClassFile(String className, Class<?>[] classes,
                                           Class<?>[] interfaces); static ClassFile buildClassFile(String className,
                                           Class<?>[] classes, 
                                           String[] prefixes); static ClassFile buildClassFile(String className,
                                           Class<?>[] classes, 
                                           String[] prefixes,
                                           Class<?>[] interfaces); static ClassFile buildClassFile(String className,
                                           Class<?>[] classes, 
                                           String[] prefixes,
                                           int observerMode); static ClassFile buildClassFile(String className,
                                           Class<?>[] classes, 
                                           String[] prefixes,
                                           Class<?>[] interfaces,
                                           int observerMode); static final int OBSERVER_DISABLED; static final int OBSERVER_ENABLED; static final int OBSERVER_ACTIVE; static final int OBSERVER_EXTERNAL; }
@Test public void testGetConstructor() throws Exception { Constructor<?> ctor = MergedClass.getConstructor ( ClassInjector.getInstance(), new Class[] { Dog.class, Cat.class }, new String[] { "Dog$", "Cat$" } ); assertNotNull("invalid ctor", ctor); Object instance = ctor.newInstance(new Dog(), new Cat()); try { instance.getClass().getMethod("getLegs"); fail("expected getLegs method to be invalid as it conflicts"); } catch (NoSuchMethodException nsme) { } Method dmethod = instance.getClass().getMethod("Dog$getLegs"); Object dresult = dmethod.invoke(instance); assertEquals("invalid Dog.getLegs value", Integer.valueOf(1), dresult); Method cmethod = instance.getClass().getMethod("Cat$getLegs"); Object cresult = cmethod.invoke(instance); assertEquals("invalid Cat.getLegs value", Double.valueOf(2.0), cresult); assertFalse("invalid equals(null)", instance.equals(null)); assertTrue("invalid equality to itself", instance.equals(instance)); assertFalse("expected non-empty string", instance.toString().isEmpty()); }