### Question:
Classes { public static Class<?> forName(String className) { try { return Class.forName(className); } catch (ClassNotFoundException e) { throw new IllegalStateException("Cannot load class " + className); } } private  Classes(); static T instanciate(Class<? extends T> clazz); static boolean isPresent(String className); static Class<?> forName(String className); static T getValueFromProtectedField(Object object, String fieldName);  }### Answer:
@Test void forName_returns_class_object_when_present_on_classpath() { assertThat(Classes.forName("java.lang.String")).isEqualTo(String.class); }
@Test void forName_throws_when_class_is_not_on_classpath() { assertThatExceptionOfType(IllegalStateException.class) .isThrownBy(() -> Classes.forName("missing.Someclass")) .withMessage("Cannot load class missing.Someclass"); }