### Question:
ConstructorResolver { public ConstructorExecutable resolve(Components dependencies) { List<Constructor> constructors = asList(clazz.getConstructors()); constructors.sort((ctor1, ctor2) -> ctor2.getParameterCount() - ctor1.getParameterCount()); for (Constructor constructor : constructors) { try { return satisfy(constructor, dependencies); }catch (ComponentNotFound ignored){ } } throw new ConstructorNotFound(clazz, dependencies); } ConstructorResolver(Class clazz); ConstructorExecutable resolve(Components dependencies);  }### Answer:
@Test public void should_resolve_default_constructor() { ConstructorResolver resolver = new ConstructorResolver(String.class); ConstructorExecutable constructorExecutable = resolver.resolve(new Components()); assertThat(constructorExecutable.instantiate(), is("")); }
@Test(expected = ConstructorNotFound.class) public void should_raise_exception_if_proper_constructor_not_found() { ConstructorResolver resolver = new ConstructorResolver(Integer.class); resolver.resolve(new Components()); }
@Test public void should_resolve_constructor_with_appropriate_parameters() throws NoSuchMethodException { ConstructorResolver resolver = new ConstructorResolver(Integer.class); Components components = new Components(); components.add("1"); ConstructorExecutable executable = resolver.resolve(components); assertThat(executable.instantiate(), is(1)); }