class BaseExceptionHandler {

    public <R extends Exception> T mapException(R exception) {
        return mapper
                .getOrDefault(exception.getClass(), this::internalError)
                .apply(exception);
    }

    public  BaseExceptionHandler();

}