code: public static <R> OnSubscribe<R> when(final Iterable<? extends Plan0<R>> plans) {
          if (plans == null) {
              throw new NullPointerException("plans");
          }
          return new OnSubscribe<R>() {
              @Override
              public void call(final Subscriber<? super R> t1) {
                  final Map<Object, JoinObserver> externalSubscriptions = new HashMap<Object, JoinObserver>();
                  final Object gate = new Object();
                  final List<ActivePlan0> activePlans = new ArrayList<ActivePlan0>();
  
                  final Observer<R> out = new Observer<R>() {
                      @Override
                      public void onNext(R args) {
                          t1.onNext(args);
                      }
  
                      @Override
                      public void onError(Throwable e) {
                          for (JoinObserver po : externalSubscriptions.values()) {
                              po.unsubscribe();
                          }
                          t1.onError(e);
                      }
  
                      @Override
                      public void onCompleted() {
                          t1.onCompleted();
                      }
                  };
  
                  try {
                      for (Plan0<R> plan : plans) {
                          activePlans.add(plan.activate(externalSubscriptions, out, new Action1<ActivePlan0>() {
                              @Override
                              public void call(ActivePlan0 activePlan) {
                                  activePlans.remove(activePlan);
                                  if (activePlans.isEmpty()) {
                                      out.onCompleted();
                                  }
                              }
                          }));
                      }
                  } catch (Throwable t) {
                      Observable.<R> error(t).unsafeSubscribe(t1);
                      return;
                  }
                  CompositeSubscription group = new CompositeSubscription();
                  t1.add(group);
                  for (JoinObserver jo : externalSubscriptions.values()) {
                      jo.subscribe(gate);
                      group.add(jo);
                  }
              }
          };
      }
docs: Joins together the results from several patterns.