src/main/java/io/reactivex/subjects/ReplaySubject.java
@CheckReturnValue
    @NonNull
    public static <T> ReplaySubject<T> createWithSize(int maxSize) {
        return new ReplaySubject<T>(new SizeBoundReplayBuffer<T>(maxSize));
    }
@CheckReturnValue
    @NonNull
    public static <T> ReplaySubject<T> createWithSize(int maxSize) {
        return new ReplaySubject<T>(new SizeBoundReplayBuffer<T>(maxSize));
    }
Creates a size-bounded replay subject.
<p>
In this setting, the {@code ReplaySubject} holds at most {@code size} items in its internal buffer and
discards the oldest item.
<p>
When observers subscribe to a terminated {@code ReplaySubject}, they are guaranteed to see at most
{@code size} {@code onNext} events followed by a termination event.
<p>
If an observer subscribes while the {@code ReplaySubject} is active, it will observe all items in the
buffer at that point in time and each item observed afterwards, even if the buffer evicts items due to
the size constraint in the mean time. In other words, once an Observer subscribes, it will receive items
without gaps in the sequence.

@param <T>
the type of items observed and emitted by the Subject
@param maxSize
the maximum number of buffered items
@return the created subject