code: protected void addIndexContents(Profiles profiles, String text,
              String tableSummary, Content body) {
          if (profiles.getProfileCount() > 0) {
              HtmlTree div = new HtmlTree(HtmlTag.DIV);
              div.addStyle(HtmlStyle.indexHeader);
              addAllClassesLink(div);
              addAllPackagesLink(div);
              body.addContent(div);
              addProfilesList(profiles, text, tableSummary, body);
          }
      }
docs: Adds profile index contents. Call appropriate methods from
  the sub-classes. Adds it to the body HtmlTree
  
  @param profiles profiles to be documented
  @param text string which will be used as the heading
  @param tableSummary summary for the table
  @param body the document tree to which the index contents will be added