code: public static Map<String, List<Interaction>> getConnectionListenerData(List<Interaction> data)
     {
        Map<String, List<Interaction>> result = new TreeMap<String, List<Interaction>>();
  
        for (int i = 0; i < data.size(); i++)
        {
           Interaction interaction = data.get(i);
  
           List<Interaction> l = result.get(interaction.getConnectionListener());
  
           if (l == null)
              l = new ArrayList<Interaction>();
  
           l.add(interaction);
  
           result.put(interaction.getConnectionListener(), l);
        }
  
        return result;
     }
docs: Get a connection listener map
  @param data The data
  @return The result