test_class.file: reactfx/src/test/java/org/reactfx/ThreadBridgeTest.java
test_class.identifier: ThreadBridgeTest
test_case.body: @Test
      public void test() throws InterruptedException, ExecutionException {
          ThreadFactory threadFactory1 = runnable -> new Thread(runnable, "thread 1");
          ThreadFactory threadFactory2 = runnable -> new Thread(runnable, "thread 2");
          ExecutorService exec1 = Executors.newSingleThreadExecutor(threadFactory1);
          ExecutorService exec2 = Executors.newSingleThreadExecutor(threadFactory2);
          EventSource<Integer> src1 = new EventSource<>();
          EventStream<Integer> stream2 = src1.threadBridge(exec1, exec2);
          EventStream<Integer> stream1 = stream2.threadBridge(exec2, exec1);
  
          List<Integer> emittedFrom2 = new ArrayList<>();
          List<Integer> emittedFrom1 = new ArrayList<>();
          List<String> emissionThreads2 = new ArrayList<>();
          List<String> emissionThreads1 = new ArrayList<>();
  
          CompletableFuture<List<Integer>> emittedFrom2Final = new CompletableFuture<>();
          CompletableFuture<List<Integer>> emittedFrom1Final = new CompletableFuture<>();
          CompletableFuture<List<String>> emissionThreads2Final = new CompletableFuture<>();
          CompletableFuture<List<String>> emissionThreads1Final = new CompletableFuture<>();
  
          CountDownLatch subscribed = new CountDownLatch(2);
          exec2.execute(() -> {
              stream2.subscribe(i -> {
                  if(i != null) {
                      emittedFrom2.add(i);
                      emissionThreads2.add(Thread.currentThread().getName());
                  } else {
                      emittedFrom2Final.complete(emittedFrom2);
                      emissionThreads2Final.complete(emissionThreads2);
                  }
              });
              subscribed.countDown();
          });
          exec1.execute(() -> {
              stream1.subscribe(i -> {
                  if(i != null) {
                      emittedFrom1.add(i);
                      emissionThreads1.add(Thread.currentThread().getName());
                  } else {
                      emittedFrom1Final.complete(emittedFrom1);
                      emissionThreads1Final.complete(emissionThreads1);
                  }
              });
              subscribed.countDown();
          });
  
          subscribed.await();
          exec1.execute(() -> {
              src1.push(1);
              src1.push(2);
              src1.push(3);
              src1.push(null);
          });
  
          assertEquals(Arrays.asList(1, 2, 3), emittedFrom2Final.get());
          assertEquals(Arrays.asList(1, 2, 3), emittedFrom1Final.get());
          assertEquals(Arrays.asList("thread 2", "thread 2", "thread 2"), emissionThreads2Final.get());
          assertEquals(Arrays.asList("thread 1", "thread 1", "thread 1"), emissionThreads1Final.get());
  
          exec1.shutdown();
          exec2.shutdown();
      }
test_case.class_method_signature: ThreadBridgeTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: newSingleThreadExecutor newSingleThreadExecutor threadBridge threadBridge execute subscribe add add getName currentThread complete complete countDown execute subscribe add add getName currentThread complete complete countDown await execute push push push push assertEquals asList get assertEquals asList get assertEquals asList get assertEquals asList get shutdown shutdown
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: input
focal_class.modifier: private final
focal_class.original_string: private final EventStream<T> input;
focal_class.type: EventStream<T>
focal_class.var_name: input
focal_class.declarator: sourceThreadExecutor
focal_class.modifier: private final
focal_class.original_string: private final Executor sourceThreadExecutor;
focal_class.type: Executor
focal_class.var_name: sourceThreadExecutor
focal_class.declarator: targetThreadExecutor
focal_class.modifier: private final
focal_class.original_string: private final Executor targetThreadExecutor;
focal_class.type: Executor
focal_class.var_name: targetThreadExecutor
focal_class.file: reactfx/src/main/java/org/reactfx/ThreadBridge.java
focal_class.identifier: ThreadBridge
focal_class.class_method_signature: ThreadBridge.ThreadBridge(
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)
focal_class.full_signature: public  ThreadBridge(
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)
focal_class.identifier: ThreadBridge
focal_class.modifiers: public
focal_class.parameters: (
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)
focal_class.signature:  ThreadBridge(
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)
focal_class.class_method_signature: ThreadBridge.observeInputs()
focal_class.full_signature: @Override protected Subscription observeInputs()
focal_class.identifier: observeInputs
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: Subscription
focal_class.signature: Subscription observeInputs()
focal_class.superclass: extends EventStreamBase<T>
focal_method.body: public ThreadBridge(
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor) {
          this.input = input;
          this.sourceThreadExecutor = sourceThreadExecutor;
          this.targetThreadExecutor = targetThreadExecutor;
      }
focal_method.class_method_signature: ThreadBridge.ThreadBridge(
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)
focal_method.full_signature: public  ThreadBridge(
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)
focal_method.identifier: ThreadBridge
focal_method.modifiers: public
focal_method.parameters: (
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)
focal_method.signature:  ThreadBridge(
              EventStream<T> input,
              Executor sourceThreadExecutor,
              Executor targetThreadExecutor)