docs: private int countInstances(HeaderElement root) {
          int count = 0;
          HeaderElement elem = root;
          while (null != elem) {
              if (!elem.wasRemoved()) {
                  count++;
              }
              elem = elem.nextInstance;
          }
          return count;
      }