@SuppressWarnings("unchecked")
    public <T extends KnowledgeIndex> T getKnowledge(Class<T> type, Function<Model, T> constructor) {
        return (T) blackboard.computeIfAbsent(type.getName(), t -> constructor.apply(this));
    }
Gets a computed "knowledge index" of a specific type for the model
and caches it for subsequent retrieval.

<p>This method should not typically be called directly because
KnowledgeIndex classes should all provide a public static {@code of}
method that accepts a {@code Model} and returns an instance of the
index by invoking {@code getKnowledge}.

<p>If a {@link KnowledgeIndex} of the given type has not yet been
computed, one will be created using the provided {@code constructor}
function that accepts a {@link Model}. Computed knowledge indexes are
cached and returned on subsequent retrievals.

@param type Type of knowledge index to retrieve.
@param constructor The method used to create {@code type}.
@param <T> The type of knowledge index to retrieve.
@return Returns the computed knowledge index.
smithy-model/src/main/java/software/amazon/smithy/model/Model.java