code: @SuppressWarnings("UnusedDeclaration")
      public int getNestedChildCount() {
          ArrayList<Account> stack = new ArrayList<Account>();
          int size = 0;
  
          stack.add(this);
          while (stack.size() > 0) {
              Account current = stack.get(0);
              stack.remove(0);
              for (Account child : current.getChildren()) {
                  size++;
                  if (child.hasChildren())
                      stack.add(child);
              }
          }
  
          return size;
      }
docs: Gets the count of all children (of children of children...).
  
  @return The total number of all descendants.