private void throwIfBuiltInStore(final StateStore stateStore) {
        if (stateStore instanceof VersionedKeyValueStore) {
            throw new IllegalArgumentException("Store " + stateStore.name()
                                                   + " is a versioned key-value store and should be accessed via `getVersionedKeyValueStore()`");
        }
        if (stateStore instanceof TimestampedKeyValueStore) {
            throw new IllegalArgumentException("Store " + stateStore.name()
                                                   + " is a timestamped key-value store and should be accessed via `getTimestampedKeyValueStore()`");
        }
        if (stateStore instanceof ReadOnlyKeyValueStore) {
            throw new IllegalArgumentException("Store " + stateStore.name()
                                                   + " is a key-value store and should be accessed via `getKeyValueStore()`");
        }
        if (stateStore instanceof TimestampedWindowStore) {
            throw new IllegalArgumentException("Store " + stateStore.name()
                                                   + " is a timestamped window store and should be accessed via `getTimestampedWindowStore()`");
        }
        if (stateStore instanceof ReadOnlyWindowStore) {
            throw new IllegalArgumentException("Store " + stateStore.name()
                                                   + " is a window store and should be accessed via `getWindowStore()`");
        }
        if (stateStore instanceof ReadOnlySessionStore) {
            throw new IllegalArgumentException("Store " + stateStore.name()
                                                   + " is a session store and should be accessed via `getSessionStore()`");
        }
    }
Get the {@link StateStore} with the given name.
The store can be a "regular" or global store.
<p>
Should be used for custom stores only.
For built-in stores, the corresponding typed methods like {@link #getKeyValueStore(String)} should be used.
<p>
This is often useful in test cases to pre-populate the store before the test case instructs the topology to
{@link TestInputTopic#pipeInput(TestRecord) process an input message}, and/or to check the store afterward.

@param name the name of the store
@return the state store, or {@code null} if no store has been registered with the given name
@throws IllegalArgumentException if the store is a built-in store like {@link KeyValueStore},
{@link WindowStore}, or {@link SessionStore}

@see #getAllStateStores()
@see #getKeyValueStore(String)
@see #getTimestampedKeyValueStore(String)
@see #getVersionedKeyValueStore(String)
@see #getWindowStore(String)
@see #getTimestampedWindowStore(String)
@see #getSessionStore(String)
streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java