    @Test
    public void should_allow_one_subscription() {

        // given
        PublishSubject<Integer> subject = PublishSubject.create();
        Observable<Integer> limitedObservable = SubscriptionLimiter.limitSubscriptions(1, subject);
        TestSubscriber<Integer> subscriber = new TestSubscriber<>();
        // when
        limitedObservable.subscribe(subscriber);
        subject.onNext(123);
        // then
        assertThat(subscriber.getOnNextEvents()).hasSize(1).contains(123);
    }