public static void checkForInstantiation(Class<?> clazz) {
        final String errorMessage = checkForInstantiationError(clazz);

        if (errorMessage != null) {
            throw new RuntimeException(
                    "The class '" + clazz.getName() + "' is not instantiable: " + errorMessage);
        }
    }
@Test
    void testCheckForInstantiationOfPrivateClass() {
        assertThatThrownBy(() -> InstantiationUtil.checkForInstantiation(TestClass.class))
                .isInstanceOf(RuntimeException.class);
    }