test_class.declarator: observer
test_class.original_string: Subscriber<String> observer;
test_class.type: Subscriber<String>
test_class.var_name: observer
test_class.file: rxjava/src/test/java/io/reactivex/subscribers/SerializedSubscriberTest.java
test_class.identifier: SerializedSubscriberTest
test_case.body: @Test
      public void runOutOfOrderConcurrencyTest() {
          ExecutorService tp = Executors.newFixedThreadPool(20);
          try {
              TestConcurrencySubscriber tw = new TestConcurrencySubscriber();
              // we need Synchronized + SafeSubscriber to handle synchronization plus life-cycle
              Subscriber<String> w = serializedSubscriber(new SafeSubscriber<String>(tw));
  
              Future<?> f1 = tp.submit(new OnNextThread(w, 12000));
              Future<?> f2 = tp.submit(new OnNextThread(w, 5000));
              Future<?> f3 = tp.submit(new OnNextThread(w, 75000));
              Future<?> f4 = tp.submit(new OnNextThread(w, 13500));
              Future<?> f5 = tp.submit(new OnNextThread(w, 22000));
              Future<?> f6 = tp.submit(new OnNextThread(w, 15000));
              Future<?> f7 = tp.submit(new OnNextThread(w, 7500));
              Future<?> f8 = tp.submit(new OnNextThread(w, 23500));
  
              Future<?> f10 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onComplete, f1, f2, f3, f4));
              try {
                  Thread.sleep(1);
              } catch (InterruptedException e) {
                  // ignore
              }
              Future<?> f11 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onComplete, f4, f6, f7));
              Future<?> f12 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onComplete, f4, f6, f7));
              Future<?> f13 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onComplete, f4, f6, f7));
              Future<?> f14 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onComplete, f4, f6, f7));
              // // the next 4 onError events should wait on same as f10
              Future<?> f15 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onError, f1, f2, f3, f4));
              Future<?> f16 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onError, f1, f2, f3, f4));
              Future<?> f17 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onError, f1, f2, f3, f4));
              Future<?> f18 = tp.submit(new CompletionThread(w, TestConcurrencySubscriberEvent.onError, f1, f2, f3, f4));
  
              waitOnThreads(f1, f2, f3, f4, f5, f6, f7, f8, f10, f11, f12, f13, f14, f15, f16, f17, f18);
              @SuppressWarnings("unused")
              int numNextEvents = tw.assertEvents(null); // no check of type since we don't want to test barging results here, just interleaving behavior
              //            System.out.println("Number of events executed: " + numNextEvents);
          } catch (Throwable e) {
              fail("Concurrency test failed: " + e.getMessage());
              e.printStackTrace();
          } finally {
              tp.shutdown();
              try {
                  tp.awaitTermination(5000, TimeUnit.MILLISECONDS);
              } catch (InterruptedException e) {
                  e.printStackTrace();
              }
          }
      }
test_case.class_method_signature: SerializedSubscriberTest.runOutOfOrderConcurrencyTest()
test_case.full_signature: @Test public void runOutOfOrderConcurrencyTest()
test_case.identifier: runOutOfOrderConcurrencyTest
test_case.invocations: newFixedThreadPool serializedSubscriber submit submit submit submit submit submit submit submit submit sleep submit submit submit submit submit submit submit submit waitOnThreads assertEvents fail getMessage printStackTrace shutdown awaitTermination printStackTrace
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void runOutOfOrderConcurrencyTest()
focal_class.declarator: actual
focal_class.modifier: final
focal_class.original_string: final Subscriber<? super T> actual;
focal_class.type: Subscriber<? super T>
focal_class.var_name: actual
focal_class.declarator: delayError
focal_class.modifier: final
focal_class.original_string: final boolean delayError;
focal_class.type: boolean
focal_class.var_name: delayError
focal_class.declarator: QUEUE_LINK_SIZE = 4
focal_class.modifier: static final
focal_class.original_string: static final int QUEUE_LINK_SIZE = 4;
focal_class.type: int
focal_class.var_name: QUEUE_LINK_SIZE
focal_class.declarator: subscription
focal_class.original_string: Subscription subscription;
focal_class.type: Subscription
focal_class.var_name: subscription
focal_class.declarator: emitting
focal_class.original_string: boolean emitting;
focal_class.type: boolean
focal_class.var_name: emitting
focal_class.declarator: queue
focal_class.original_string: AppendOnlyLinkedArrayList<Object> queue;
focal_class.type: AppendOnlyLinkedArrayList<Object>
focal_class.var_name: queue
focal_class.declarator: done
focal_class.modifier: volatile
focal_class.original_string: volatile boolean done;
focal_class.type: boolean
focal_class.var_name: done
focal_class.file: rxjava/src/main/java/io/reactivex/subscribers/SerializedSubscriber.java
focal_class.identifier: SerializedSubscriber
focal_class.interfaces: implements FlowableSubscriber<T>, Subscription
focal_class.class_method_signature: SerializedSubscriber.SerializedSubscriber(Subscriber<? super T> actual)
focal_class.full_signature: public  SerializedSubscriber(Subscriber<? super T> actual)
focal_class.identifier: SerializedSubscriber
focal_class.modifiers: public
focal_class.parameters: (Subscriber<? super T> actual)
focal_class.signature:  SerializedSubscriber(Subscriber<? super T> actual)
focal_class.class_method_signature: SerializedSubscriber.SerializedSubscriber(Subscriber<? super T> actual, boolean delayError)
focal_class.full_signature: public  SerializedSubscriber(Subscriber<? super T> actual, boolean delayError)
focal_class.identifier: SerializedSubscriber
focal_class.modifiers: public
focal_class.parameters: (Subscriber<? super T> actual, boolean delayError)
focal_class.signature:  SerializedSubscriber(Subscriber<? super T> actual, boolean delayError)
focal_class.class_method_signature: SerializedSubscriber.onSubscribe(Subscription s)
focal_class.full_signature: @Override public void onSubscribe(Subscription s)
focal_class.identifier: onSubscribe
focal_class.modifiers: @Override public
focal_class.parameters: (Subscription s)
focal_class.return: void
focal_class.signature: void onSubscribe(Subscription s)
focal_class.class_method_signature: SerializedSubscriber.onNext(T t)
focal_class.full_signature: @Override public void onNext(T t)
focal_class.identifier: onNext
focal_class.modifiers: @Override public
focal_class.parameters: (T t)
focal_class.return: void
focal_class.signature: void onNext(T t)
focal_class.class_method_signature: SerializedSubscriber.onError(Throwable t)
focal_class.full_signature: @Override public void onError(Throwable t)
focal_class.identifier: onError
focal_class.modifiers: @Override public
focal_class.parameters: (Throwable t)
focal_class.return: void
focal_class.signature: void onError(Throwable t)
focal_class.class_method_signature: SerializedSubscriber.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_class.class_method_signature: SerializedSubscriber.emitLoop()
focal_class.full_signature:  void emitLoop()
focal_class.identifier: emitLoop
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void emitLoop()
focal_class.class_method_signature: SerializedSubscriber.request(long n)
focal_class.full_signature: @Override public void request(long n)
focal_class.identifier: request
focal_class.modifiers: @Override public
focal_class.parameters: (long n)
focal_class.return: void
focal_class.signature: void request(long n)
focal_class.class_method_signature: SerializedSubscriber.cancel()
focal_class.full_signature: @Override public void cancel()
focal_class.identifier: cancel
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void cancel()
focal_method.body: public SerializedSubscriber(Subscriber<? super T> actual) {
          this(actual, false);
      }
focal_method.class_method_signature: SerializedSubscriber.SerializedSubscriber(Subscriber<? super T> actual)
focal_method.full_signature: public  SerializedSubscriber(Subscriber<? super T> actual)
focal_method.identifier: SerializedSubscriber
focal_method.modifiers: public
focal_method.parameters: (Subscriber<? super T> actual)
focal_method.signature:  SerializedSubscriber(Subscriber<? super T> actual)