@SuppressWarnings("checkstyle:npathcomplexity")
    public static <T extends Throwable> T tryCreateExceptionWithMessageAndCause(Class<T> exceptionClass, String message,
                                                                                @Nullable Throwable cause) {
        for (ConstructorMethod method : ConstructorMethod.values()) {
            try {
                return method.cloneException(exceptionClass, message, cause);
            } catch (ClassCastException | WrongMethodTypeException | IllegalAccessException
                     | SecurityException | NoSuchMethodException | ClassNotFoundException ignored) {
            } catch (Throwable t) {
                throw new RuntimeException("Exception creation failed ", t);
            }
        }
        return null;
    }
@Test
    public void testCanCreateExceptionsWithMessageAndCauseWhenExceptionHasCauseSetImplicitlyByNoArgumentConstructor() {
        ExceptionUtil.tryCreateExceptionWithMessageAndCause(
                ExceptionThatHasCauseImplicitlyByNoArgumentConstructor.class, "", new RuntimeException()
        );
    }