util-moduleloader/src/main/java/com/hpe/caf/util/ModuleProvider.java
public <T> T getModule(final Class<T> interfaceImplemented, final String moduleType) throws NullPointerException
    {
        //check for this type in the map
        Map<String, Object> computedValue = loadedModules.computeIfAbsent(interfaceImplemented, ModuleProvider::loadModules);
        Object moduleInstance = computedValue.get(moduleType);
        Objects.requireNonNull(
            moduleInstance, "Unable to find implementation of " + interfaceImplemented.getName() + " with moduleType " + moduleType);
        return (T) moduleInstance;
    }
public <T> T getModule(final Class<T> interfaceImplemented, final String moduleType) throws NullPointerException
    {
        //check for this type in the map
        Map<String, Object> computedValue = loadedModules.computeIfAbsent(interfaceImplemented, ModuleProvider::loadModules);
        Object moduleInstance = computedValue.get(moduleType);
        Objects.requireNonNull(
            moduleInstance, "Unable to find implementation of " + interfaceImplemented.getName() + " with moduleType " + moduleType);
        return (T) moduleInstance;
    }
Retrieves a module by its simple name, that implements a particular type T

@param interfaceImplemented The interface that 'moduleType' implements and that the result should be returned as.
@param moduleType Represents particular instance of a factory type object e.g. 'ExampleWorkerBuilder'
@return An instance of moduleType as the type T passed in.
@throws NullPointerException If the module cannot be retrieved with the specified moduleType.