docs: @SuppressWarnings("unchecked")
      public <T extends Tree> List<T> getLeaves(List<T> list) {
          if (isLeaf()) {
              list.add((T) this);
          } else {
              for (Tree kid : children()) {
                  kid.getLeaves(list);
              }
          }
          return list;
      }