### Question:
ConstructorExecutable { public Object instantiate() { try { return constructor.newInstance(parameters.toArray()); } catch (Exception e) { throw new InstantiationFailure(e); } } ConstructorExecutable(Constructor constructor, List<Object> parameters); Object instantiate();  }### Answer:
@Test public void should_execute_constructor() throws Exception { Constructor<String> defaultConstructor = String.class.getConstructor(); ConstructorExecutable executable = new ConstructorExecutable(defaultConstructor, emptyList()); Object result = executable.instantiate(); assertThat(result, is("")); Constructor<String> constructor = String.class.getConstructor(String.class); executable = new ConstructorExecutable(constructor, singletonList("Hello")); assertThat(executable.instantiate(), is("Hello")); }
@Test(expected = InstantiationFailure.class) public void should_handle_exceptions_gracefully() throws Exception { Constructor<String> constructor = String.class.getConstructor(String.class); ConstructorExecutable executable = new ConstructorExecutable(constructor, emptyList()); executable.instantiate(); }