public void defineDocStringType(DocStringType docStringType) {
        DocStringType existing = lookupByContentTypeAndType(docStringType.getContentType(), docStringType.getType());
        if (existing != null) {
            throw createDuplicateTypeException(existing, docStringType);
        }
        Map<Type, DocStringType> map = docStringTypes.computeIfAbsent(docStringType.getContentType(),
            s -> new HashMap<>());
        map.put(docStringType.getType(), docStringType);
        docStringTypes.put(docStringType.getContentType(), map);
    }
@Test
    void doc_string_types_of_same_content_type_must_have_unique_return_type() {
        registry.defineDocStringType(new DocStringType(
            JsonNode.class,
            "application/json",
            (String s) -> null));

        DocStringType duplicate = new DocStringType(
            JsonNode.class,
            "application/json",
            (String s) -> null);

        CucumberDocStringException exception = assertThrows(
            CucumberDocStringException.class,
            () -> registry.defineDocStringType(duplicate));
        assertThat(exception.getMessage(), is("" +
                "There is already docstring type registered for 'application/json' and com.fasterxml.jackson.databind.JsonNode.\n"
                +
                "You are trying to add 'application/json' and com.fasterxml.jackson.databind.JsonNode"));
    }