code: public Selector append(Selector tail) {
          if (right == null) {
              if (combinator != null) {
                  throw new IllegalStateException();
              }
              return new Selector(left, null, tail);
          } else {
              return new Selector(left, combinator, right.append(tail));
          }
      }
docs: lisp-like list-append