code: private void addConnections(Collection<Connection> connections)
          throws GuacamoleException {
  
          // Add each connection to the tree
          for (Connection connection : connections) {
  
              // Retrieve the connection's parent group
              APIConnectionGroup parent = retrievedGroups.get(connection.getParentIdentifier());
              if (parent != null) {
  
                  Collection<APIConnection> children = parent.getChildConnections();
                  
                  // Create child collection if it does not yet exist
                  if (children == null) {
                      children = new ArrayList<APIConnection>();
                      parent.setChildConnections(children);
                  }
  
                  // Add child
                  APIConnection apiConnection = new APIConnection(connection);
                  retrievedConnections.put(connection.getIdentifier(), apiConnection);
                  children.add(apiConnection);
                  
              }
  
              // Warn of internal consistency issues
              else
                  logger.debug("Connection \"{}\" cannot be added to the tree: parent \"{}\" does not actually exist.",
                          connection.getIdentifier(),
                          connection.getParentIdentifier());
  
          } // end for each connection
          
      }
docs: Adds each of the provided connections to the current tree as children
  of their respective parents. The parent connection groups must already
  be added.
  
  @param connections
  The connections to add to the tree.
  
  @throws GuacamoleException
  If an error occurs while adding the connection to the tree.