code: function buildGroups(reflections, parent, callback) {
                      var state = -1;
                      var hasExternals = containsExternals(reflections);
                      sortReflections(reflections);
                      reflections.forEach(function (reflection) {
                          if (hasExternals && !reflection.flags.isExternal && state != 1) {
                              new output.NavigationItem('Internals', null, parent, "tsd-is-external");
                              state = 1;
                          }
                          else if (hasExternals && reflection.flags.isExternal && state != 2) {
                              new output.NavigationItem('Externals', null, parent, "tsd-is-external");
                              state = 2;
                          }
                          var item = output.NavigationItem.create(reflection, parent);
                          includeDedicatedUrls(reflection, item);
                          if (callback)
                              callback(reflection, item);
                      });
                  }
docs: Create navigation nodes for the given list of reflections. The resulting nodes will be grouped into
  an "internal" and an "external" section when applicable.
  
  @param reflections  The list of reflections which should be transformed into navigation nodes.
  @param parent       The parent NavigationItem of the newly created nodes.
  @param callback     Optional callback invoked for each generated node.