private ShapeId getPreludeId(String key) {
            // computeIfAbsent isn't used here since we need to limit the cache size and creating multiple IDs
            // simultaneously isn't an issue.
            ShapeId result = preludeCache.get(key);
            if (result != null) {
                return result;
            }

            // The ID wasn't found so build it, and add it to the cache if the cache isn't too big already.
            result = buildShapeId(key);

            if (preludeCache.size() <= PRELUDE_MAX_SIZE) {
                preludeCache.putIfAbsent(key, result);
            }

            return result;
        }
A least-recently used flyweight factory that creates shape IDs.

<p>Prelude IDs are stored separately from non-prelude IDs because we can make a reasonable estimate about the
size of the prelude and stop caching IDs when that size is exceeded. Prelude shapes are stored in a
ConcurrentHashMap with a bounded size. Once the size exceeds 500, then items are no longer stored in the cache.
Non-prelude shapes are stored in a bounded, synchronized LRU cache based on {@link LinkedHashMap}.
smithy-model/src/main/java/software/amazon/smithy/model/shapes/ShapeId.java