code: public final AbstractGedLine readToNext() throws IOException {
          AbstractGedLine gedLine = source.createGedLine(this);
          while (true) {
              if (gedLine == null || gedLine.getLevel() == -1) {
                  break;
              }
  
              if (gedLine.getLevel() <= this.getLevel()) {
                  return gedLine;
              }
  
              children.add(gedLine);
  
              gedLine = gedLine.readToNext();
          }
  
          return null;
      }
docs: Read the source data until the a line is encountered at the same level as
  this one. That allows the reading of children.
  
  @return The GedLine at the current level. Null if the end of data is
  reached first.
  @throws IOException If this is a file source and we encounter a problem.