public static WindowBytesStoreSupplier inMemoryWindowStore(final String name,
                                                               final Duration retentionPeriod,
                                                               final Duration windowSize,
                                                               final boolean retainDuplicates) throws IllegalArgumentException {
        Objects.requireNonNull(name, "name cannot be null");

        final String repartitionPeriodErrorMessagePrefix = prepareMillisCheckFailMsgPrefix(retentionPeriod, "retentionPeriod");
        final long retentionMs = validateMillisecondDuration(retentionPeriod, repartitionPeriodErrorMessagePrefix);
        if (retentionMs < 0L) {
            throw new IllegalArgumentException("retentionPeriod cannot be negative");
        }

        final String windowSizeErrorMessagePrefix = prepareMillisCheckFailMsgPrefix(windowSize, "windowSize");
        final long windowSizeMs = validateMillisecondDuration(windowSize, windowSizeErrorMessagePrefix);
        if (windowSizeMs < 0L) {
            throw new IllegalArgumentException("windowSize cannot be negative");
        }

        if (windowSizeMs > retentionMs) {
            throw new IllegalArgumentException("The retention period of the window store "
                + name + " must be no smaller than its window size. Got size=["
                + windowSize + "], retention=[" + retentionPeriod + "]");
        }

        return new InMemoryWindowBytesStoreSupplier(name, retentionMs, windowSizeMs, retainDuplicates);
    }
Create an in-memory {@link WindowBytesStoreSupplier}.
<p>
This store supplier can be passed into a {@link #windowStoreBuilder(WindowBytesStoreSupplier, Serde, Serde)} or
{@link #timestampedWindowStoreBuilder(WindowBytesStoreSupplier, Serde, Serde)}.

@param name                  name of the store (cannot be {@code null})
@param retentionPeriod       length of time to retain data in the store (cannot be negative)
                             Note that the retention period must be at least long enough to contain the
                             windowed data's entire life cycle, from window-start through window-end,
                             and for the entire grace period.
@param windowSize            size of the windows (cannot be negative)
@param retainDuplicates      whether or not to retain duplicates. Turning this on will automatically disable
                             caching and means that null values will be ignored.
@return an instance of {@link WindowBytesStoreSupplier}
@throws IllegalArgumentException if {@code retentionPeriod} or {@code windowSize} can't be represented as {@code long milliseconds}
@throws IllegalArgumentException if {@code retentionPeriod} is smaller than {@code windowSize}
streams/src/main/java/org/apache/kafka/streams/state/Stores.java