docs: public void growToivonenSocialNetwork(int networkSize, Random rand) {
          
          // load in the seed network.
          final ArrayList<LocalTrustGraphNode> networkNodes = 
              new ArrayList<LocalTrustGraphNode>(nodes.values());
          
          if (networkNodes.size() < 2) {
              throw new IllegalStateException("Not enough seed nodes.");
          }
          
          /* create the remaining nodes and links incrementally according
           * to the parameters.
           */
          for (int j = 0; j < networkSize; j++) {
              
              // pick the number of initial neighbors
              final int nInit = rand.nextFloat() >= 0.05 ? 1 : 2;
              
              // pick nInit initial neighbor nodes
              final Set<LocalTrustGraphNode> initialNeighbors =
                  new HashSet<LocalTrustGraphNode>();
              
              /* pick nInit initial neighbors uniformly at random
               * without repetition.
               */
              while (initialNeighbors.size() < nInit) {
                  initialNeighbors.add(networkNodes.get(
                      rand.nextInt(networkNodes.size())));
              }
              
              /* for each initial neighbor, pick a random number of
               * secondary neighbors ~ U[0,3]
               * 
               * Note this does not attempt to account for global 
               * repetition among all selected secondary neighbors,
               * only among a given node's neighbors.
               */
               final Set<TrustGraphNodeId> secondaryNeighbors =
                   new HashSet<TrustGraphNodeId>();
               for (LocalTrustGraphNode neighbor : initialNeighbors) {
                   /* pick the number of secondary neighbors from this
                    * neighbors set of current neighbors.
                    */
                   final int n2nd = rand.nextInt(4); // U[0,3]
                   
                   // grab the list of 2nd degree neighbors
  
                   final ArrayList<TrustGraphNodeId> all2nd =
                       new ArrayList<TrustGraphNodeId>(
                          neighbor.getRoutingTable().getOrderedNeighbors());
                   
                   /* If there are more than enough neighbors, 
                    * select random neighbors by shuffling and picking 
                    * the first n2nd elements.
                    */
                   if (all2nd.size() > n2nd) {
                       Collections.shuffle(all2nd,rand);
                       for (int i = 0; i < n2nd; i++) {
                           secondaryNeighbors.add(all2nd.get(i));
                       }
                   }
                   /* If there <= n2nd neighbors, take them all (saturation)
                    */
                   else {
                       for (TrustGraphNodeId n : all2nd) { secondaryNeighbors.add(n); }
                   }
               }
   
               // finally, add the new node, and form all the connections...
               final LocalTrustGraphNode newNode = addNode();
               networkNodes.add(newNode);
               final TrustGraphNodeId newId = newNode.getId();
               for (LocalTrustGraphNode n : initialNeighbors) { addRoute(newId, n.getId()); }
               for (TrustGraphNodeId n : secondaryNeighbors) { addRoute(newId, n); }
          }
       }