### Question:
ReflectionUtils { public static <T> Class<? extends T> resolveClassOfType(String className, Class<T> wantedClass, Class<?>... parameterClasses) throws ConfigurationException { Class<? extends T> clazz; try { clazz = Class.forName(className).asSubclass(wantedClass); } catch (ClassCastException e) { throw new ConfigurationException("Class " + className + " not assignable from " + wantedClass, e); } catch (ClassNotFoundException e) { throw new ConfigurationException("Class " + className + " not found in classpath", e); } getConstructor(clazz, parameterClasses); return clazz; } private  ReflectionUtils(); static T construct(Class<? extends T> type, Object... parameters); static T construct(Class<? extends T> type, Class<?>[] parameterClasses, Object... parameters); static Class<? extends T> resolveClassOfType(String className, Class<T> wantedClass, Class<?>... parameterClasses);  }### Answer:
@Test public void testResolveWithFaultyClassName() { assertThatExceptionOfType(ConfigurationException.class) .isThrownBy(() -> ReflectionUtils.resolveClassOfType("NonExistingClass", TestInterface.class)); }
@Test public void testResolveWithFaultyConstructor() { assertThatExceptionOfType(ConfigurationException.class) .isThrownBy(() -> ReflectionUtils.resolveClassOfType(OverridingClassWithoutConstructor.class.getName(), TestInterface.class, String.class)); }
@Test public void testResolveNonOverridingClass() { assertThatExceptionOfType(ConfigurationException.class) .isThrownBy(() -> ReflectionUtils.resolveClassOfType(NonOverridingClass.class.getName(), TestInterface.class)); }