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 anonymous_doc_string_is_predefined() {
        DocStringType docStringType = new DocStringType(
            String.class,
            DEFAULT_CONTENT_TYPE,
            (String s) -> s);

        CucumberDocStringException actualThrown = assertThrows(
            CucumberDocStringException.class, () -> registry.defineDocStringType(docStringType));
        assertThat(actualThrown.getMessage(), is(equalTo(
            "There is already docstring type registered for '[anonymous]' and java.lang.String.\n" +
                    "You are trying to add '[anonymous]' and java.lang.String")));
    }