docs: protected List<AttributeNameTest> extractAttributeNames( BinaryComponent binary ) {
          List<AttributeNameTest> results = new ArrayList<AttributeNameTest>();
          boolean failed = false;
          if (binary instanceof Union) {
              for (int i = 0; i != 2; ++i) {
                  Component comp = i == 0 ? binary.getLeft() : binary.getRight();
                  comp = comp.collapse();
                  if (comp instanceof Union) {
                      results.addAll(extractAttributeNames((BinaryComponent)comp));
                  } else if (comp instanceof AttributeNameTest) {
                      results.add((AttributeNameTest)comp);
                  } else if (comp instanceof NameTest) {
                      // Element names, which are fine but we'll ignore
                  } else {
                      failed = true;
                      break;
                  }
              }
          } else {
              failed = true;
          }
          if (failed) {
              throw new InvalidQueryException(query,
                                              "A parenthesized expression in a path step may only contain ORed and ANDed attribute names or element names; therefore '"
                                              + binary + "' is not valid");
          }
          return results;
      }