### Question:
MethodCall implements Implementation.Composable { public static MethodCall construct(Constructor<?> constructor) { return construct(new MethodDescription.ForLoadedConstructor(constructor)); } protected  MethodCall(MethodLocator.Factory methodLocator,
                         TargetHandler.Factory targetHandler,
                         List<ArgumentLoader.Factory> argumentLoaders,
                         MethodInvoker.Factory methodInvoker,
                         TerminationHandler.Factory terminationHandler,
                         Assigner assigner,
                         Assigner.Typing typing); static WithoutSpecifiedTarget invoke(Method method); static WithoutSpecifiedTarget invoke(Constructor<?> constructor); static WithoutSpecifiedTarget invoke(MethodDescription methodDescription); static WithoutSpecifiedTarget invoke(ElementMatcher<? super MethodDescription> matcher); static WithoutSpecifiedTarget invoke(ElementMatcher<? super MethodDescription> matcher, MethodGraph.Compiler methodGraphCompiler); static WithoutSpecifiedTarget invoke(MethodLocator.Factory methodLocator); static WithoutSpecifiedTarget invokeSelf(); static MethodCall invokeSuper(); static Composable call(Callable<?> callable); static Composable run(Runnable runnable); static MethodCall construct(Constructor<?> constructor); static MethodCall construct(MethodDescription methodDescription); MethodCall with(Object... argument); MethodCall with(TypeDescription... typeDescription); MethodCall with(EnumerationDescription... enumerationDescription); MethodCall with(JavaConstant... javaConstant); MethodCall withReference(Object... argument); MethodCall withArgument(int... index); MethodCall withAllArguments(); MethodCall withArgumentArray(); MethodCall withArgumentArrayElements(int index); MethodCall withArgumentArrayElements(int index, int size); MethodCall withArgumentArrayElements(int index, int start, int size); MethodCall withThis(); MethodCall withOwnType(); MethodCall withField(String... name); MethodCall withField(FieldLocator.Factory fieldLocatorFactory, String... name); MethodCall withMethodCall(MethodCall methodCall); MethodCall with(StackManipulation stackManipulation, Type type); MethodCall with(StackManipulation stackManipulation, TypeDefinition typeDefinition); MethodCall with(ArgumentLoader.Factory... argumentLoader); MethodCall with(List<? extends ArgumentLoader.Factory> argumentLoaders); FieldSetting setsField(Field field); FieldSetting setsField(FieldDescription fieldDescription); FieldSetting setsField(ElementMatcher<? super FieldDescription> matcher); Composable withAssigner(Assigner assigner, Assigner.Typing typing); Implementation andThen(Implementation implementation); Composable andThen(Composable implementation); InstrumentedType prepare(InstrumentedType instrumentedType); ByteCodeAppender appender(Target implementationTarget);  }### Answer:
@Test public void testObjectConstruction() throws Exception { DynamicType.Loaded<SelfReference> loaded = new ByteBuddy() .subclass(SelfReference.class) .method(isDeclaredBy(SelfReference.class)) .intercept(MethodCall.construct(SelfReference.class.getDeclaredConstructor())) .make() .load(SelfReference.class.getClassLoader(), ClassLoadingStrategy.Default.WRAPPER); assertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0)); assertThat(loaded.getLoaded().getDeclaredMethods().length, is(1)); assertThat(loaded.getLoaded().getDeclaredConstructors().length, is(1)); assertThat(loaded.getLoaded().getDeclaredFields().length, is(0)); SelfReference instance = loaded.getLoaded().getDeclaredConstructor().newInstance(); SelfReference created = instance.foo(); assertThat(created.getClass(), CoreMatchers.<Class<?>>is(SelfReference.class)); assertThat(instance.getClass(), not(CoreMatchers.<Class<?>>is(SelfReference.class))); assertThat(instance, instanceOf(SelfReference.class)); assertThat(created, not(instance)); }
@Test(expected = IllegalArgumentException.class) public void testConstructNonConstructorThrowsException() throws Exception { MethodCall.construct(mock(MethodDescription.class)); }