test_class.file: implementation/src/test/java/io/smallrye/reactive/streams/utils/WrappedSubscriberTest.java
test_class.identifier: WrappedSubscriberTest
test_case.body: @Test
      public void checkThatOnSubscribeCanOnlyBeCallOnce() {
          AtomicReference<Subscription> subscriptionReference = new AtomicReference<>();
          WrappedSubscriber<Integer> subscriber = new WrappedSubscriber<>(new Subscriber<Integer>() {
              @Override
              public void onSubscribe(Subscription s) {
                  subscriptionReference.set(s);
              }
  
              @Override
              public void onNext(Integer integer) {
  
              }
  
              @Override
              public void onError(Throwable t) {
  
              }
  
              @Override
              public void onComplete() {
  
              }
          });
  
          AtomicBoolean cancellationReference1 = new AtomicBoolean();
          subscriber.onSubscribe(new Subscription() {
              @Override
              public void request(long n) {
  
              }
  
              @Override
              public void cancel() {
                  cancellationReference1.set(true);
              }
          });
  
          assertThat(cancellationReference1.get()).isFalse();
          assertThat(subscriptionReference.get()).isNotNull();
  
          AtomicBoolean cancellationReference2 = new AtomicBoolean();
          subscriber.onSubscribe(new Subscription() {
              @Override
              public void request(long n) {
  
              }
  
              @Override
              public void cancel() {
                  cancellationReference2.set(true);
              }
          });
  
          assertThat(cancellationReference1.get()).isFalse();
          assertThat(cancellationReference2.get()).isTrue();
          assertThat(subscriptionReference.get()).isNotNull();
  
      }
test_case.class_method_signature: WrappedSubscriberTest.checkThatOnSubscribeCanOnlyBeCallOnce()
test_case.full_signature: @Test public void checkThatOnSubscribeCanOnlyBeCallOnce()
test_case.identifier: checkThatOnSubscribeCanOnlyBeCallOnce
test_case.invocations: set onSubscribe set isFalse assertThat get isNotNull assertThat get onSubscribe set isFalse assertThat get isTrue assertThat get isNotNull assertThat get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void checkThatOnSubscribeCanOnlyBeCallOnce()
focal_class.declarator: future = new CompletableFuture<>()
focal_class.modifier: private final
focal_class.original_string: private final CompletableFuture<Void> future = new CompletableFuture<>();
focal_class.type: CompletableFuture<Void>
focal_class.var_name: future
focal_class.declarator: source
focal_class.modifier: private final
focal_class.original_string: private final Subscriber<T> source;
focal_class.type: Subscriber<T>
focal_class.var_name: source
focal_class.declarator: subscribed = new AtomicBoolean(false)
focal_class.modifier: private final
focal_class.original_string: private final AtomicBoolean subscribed = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: subscribed
focal_class.file: implementation/src/main/java/io/smallrye/reactive/streams/utils/WrappedSubscriber.java
focal_class.identifier: WrappedSubscriber
focal_class.interfaces: implements Subscriber<T>
focal_class.class_method_signature: WrappedSubscriber.WrappedSubscriber(Subscriber<T> delegate)
focal_class.full_signature: public  WrappedSubscriber(Subscriber<T> delegate)
focal_class.identifier: WrappedSubscriber
focal_class.modifiers: public
focal_class.parameters: (Subscriber<T> delegate)
focal_class.signature:  WrappedSubscriber(Subscriber<T> delegate)
focal_class.class_method_signature: WrappedSubscriber.future()
focal_class.full_signature: public CompletionStage<Void> future()
focal_class.identifier: future
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: CompletionStage<Void>
focal_class.signature: CompletionStage<Void> future()
focal_class.class_method_signature: WrappedSubscriber.onSubscribe(Subscription subscription)
focal_class.full_signature: @Override public void onSubscribe(Subscription subscription)
focal_class.identifier: onSubscribe
focal_class.modifiers: @Override public
focal_class.parameters: (Subscription subscription)
focal_class.return: void
focal_class.signature: void onSubscribe(Subscription subscription)
focal_class.class_method_signature: WrappedSubscriber.onNext(T item)
focal_class.full_signature: @Override public void onNext(T item)
focal_class.identifier: onNext
focal_class.modifiers: @Override public
focal_class.parameters: (T item)
focal_class.return: void
focal_class.signature: void onNext(T item)
focal_class.class_method_signature: WrappedSubscriber.onError(Throwable throwable)
focal_class.full_signature: @Override public void onError(Throwable throwable)
focal_class.identifier: onError
focal_class.modifiers: @Override public
focal_class.parameters: (Throwable throwable)
focal_class.return: void
focal_class.signature: void onError(Throwable throwable)
focal_class.class_method_signature: WrappedSubscriber.onComplete()
focal_class.full_signature: @Override public void onComplete()
focal_class.identifier: onComplete
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void onComplete()
focal_method.body: @Override
      public void onSubscribe(Subscription subscription) {
          Objects.requireNonNull(subscription);
          if (subscribed.compareAndSet(false, true)) {
              source.onSubscribe(
                      new WrappedSubscription(subscription, () -> future.completeExceptionally(new CancellationException())));
          } else {
              subscription.cancel();
          }
      }
focal_method.class_method_signature: WrappedSubscriber.onSubscribe(Subscription subscription)
focal_method.full_signature: @Override public void onSubscribe(Subscription subscription)
focal_method.identifier: onSubscribe
focal_method.invocations: requireNonNull compareAndSet onSubscribe completeExceptionally cancel
focal_method.modifiers: @Override public
focal_method.parameters: (Subscription subscription)
focal_method.return: void
focal_method.signature: void onSubscribe(Subscription subscription)