src/main/java/io/reactivex/subjects/UnicastSubject.java
@CheckReturnValue
    @NonNull
    public static <T> UnicastSubject<T> create(int capacityHint, Runnable onTerminate) {
        return new UnicastSubject<T>(capacityHint, onTerminate, true);
    }
@CheckReturnValue
    @NonNull
    public static <T> UnicastSubject<T> create(int capacityHint, Runnable onTerminate) {
        return new UnicastSubject<T>(capacityHint, onTerminate, true);
    }
Creates an UnicastSubject with the given internal buffer capacity hint and a callback for
the case when the single Subscriber cancels its subscription.

<p>The callback, if not null, is called exactly once and
non-overlapped with any active replay.

@param <T> the value type
@param capacityHint the hint to size the internal unbounded buffer
@param onTerminate the callback to run when the Subject is terminated or cancelled, null not allowed
@return an UnicastSubject instance