public <T extends AbstractConfig> T getConfigObject(final Class<T> clazz) {
        final AbstractConfig config = configInstanceMap.get(clazz);
        Objects.requireNonNull(
                config,
                "No config instance found for class " + clazz.getName());
        try {
            return clazz.cast(config);
        } catch (Exception e) {
            throw new RuntimeException(LogUtil.message(
                    "Error casting config object to {}, found {}",
                    clazz.getName(),
                    config.getClass().getName()), e);
        }
    }
Constructs a new runtime exception with the specified detail message.
The cause is not initialized, and may subsequently be initialized by a
call to {@link #initCause}.

@param message the detail message. The detail message is saved for
               later retrieval by the {@link #getMessage()} method.
stroom-config/stroom-config-global-impl/src/main/java/stroom/config/global/impl/ConfigMapper.java