source: class PublishSubjectTest extends Subject<T> {
  
      @Test
      public void TestRemoveObserverWhileNotifying() {
  
target:         PublishSubject<String> observable = new PublishSubject<>();
          final Disposable subscriptionA = observable.subscribe(new Observer<String>() {
              @Override
              public void onChanged(String value) {
                  addResult("A" + value);
              }
          });
          observable.subscribe(new Observer<String>() {
              @Override
              public void onChanged(String value) {
                  addResult("B" + value);
                  subscriptionA.dispose();
              }
          });
  
          observable.post("1");
          AssertResults("A1", "B1");
  
          observable.post("2");
          AssertResults("B2");
      }
  
  }