/** * Select a Constructor from given class's declared constructors as a test target. * * @throws RejectedChoice If class has no Constructors to choose from. */ protected Constructor<?> targetConstructorFrom(Class<?> clazz) throws RejectedChoice { Constructor<?>[] constructors = ReflectiveInterceptor.jlClassGetDeclaredConstructors(clazz); // To be deterministic we must sort these methods in a predictable fashion! Arrays.sort(constructors, new ToStringComparator()); Constructor<?> c = choice(constructors); toStringValue.append(c); return c; }