public static <T, R> Function<T, R> safeFunction(ExceptionThrowingFunction<T, R> unsafeFunc) {
        return t -> {
            try {
                return unsafeFunc.apply(t);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        };
    }
Takes a functional interface that throws an exception and returns a {@link Function} that deals with that exception by
wrapping in a runtime exception. Useful for APIs that use the standard Java functional interfaces that don't throw checked
exceptions.

@param unsafeFunc Functional interface that throws checked exception.
@param <T>        Input
@param <R>        Output
@return New {@link Function} that handles checked exception.
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/utils/FunctionalUtils.java