private void addExplorerActionHandler(final ExplorerActionHandler handler,
                                              final Map<String, DocumentType> allTypes) {
            final String type = handler.getType();
            final DocumentType documentType = DocumentTypeRegistry.get(type);
            if (documentType == null) {
                throw new RuntimeException("Unable to find a registered document type for '" + type + "'");
            }

            final ExplorerActionHandler existingActionHandler = allHandlers.putIfAbsent(type, handler);
            if (existingActionHandler != null) {
                throw new RuntimeException("A handler already exists for '" + type +
                                           "' existing {" + existingActionHandler + "} new {" + handler + "}");
            }

            final DocumentType existingDocumentType = allTypes.putIfAbsent(type, documentType);
            if (existingDocumentType != null) {
                throw new RuntimeException("A document type already exists for '" + type + "' existing {" +
                                           existingDocumentType + "} new {" + documentType + "}");
            }
        }
@param consumer {@link BiConsumer} of the document type and {@link ExplorerActionHandler}
stroom-explorer/stroom-explorer-impl/src/main/java/stroom/explorer/impl/ExplorerActionHandlers.java