private static Optional<BindInfo> addBindInfo(final Map<String, ModuleInfo> allModuleInfoMap,
                                                  final Key<?> key,
                                                  final Binding<?> binding) {
        final Class<?> bindingClass = binding.getClass();
        final Object source = binding.getSource();
        // This is the hierarchy of modules, with the first being the module the
        // key is defined in and then going up the chain.
        final List<String> moduleClassNames;
        if (source instanceof ElementSource) {
            moduleClassNames = ((ElementSource) source).getModuleClassNames();
        } else {
            moduleClassNames = Collections.emptyList();
        }

        if (!moduleClassNames.isEmpty()
            && moduleClassNames.get(0).startsWith("stroom.")) {

            final String bindingInfo = determineBindInfo(key, binding, bindingClass);
            if (bindingInfo != null) {
                final BindType bindType = determineBindType(key, binding, bindingClass);

                final Provider<?> provider = binding.getProvider();
                final ModuleInfo moduleInfo = getModuleInfo(moduleClassNames, allModuleInfoMap);
                final BindInfo bindInfo = new BindInfo(
                        key,
                        binding,
                        provider,
                        bindingInfo,
                        moduleInfo,
                        bindType);
                moduleInfo.addBind(bindInfo);
                return Optional.of(bindInfo);
            } else {
                return Optional.empty();
            }
        } else {
            return Optional.empty();
        }
    }
Create a {@link MockBinderBuilder} to bind multiple interfaces to a {@link Mockito} mock.
stroom-test-common/src/main/java/stroom/test/common/util/guice/GuiceTestUtil.java