code: private static String setCanonicalHELMSecondSection(Map<String, String> convertsortedIdstoIds, List<ConnectionNotation> connectionNotations) throws HELM1ConverterException {
      StringBuilder notation = new StringBuilder();
      for (ConnectionNotation connectionNotation : connectionNotations) {
        /* canonicalize connection */
        /* change the id's of the polymers to the sorted ids */
        List<String> connections = new ArrayList<String>();
        String source = connectionNotation.getSourceId().getId();
        String target = connectionNotation.getTargetId().getId();
  
        /* pairs will be not shown */
        if (!(connectionNotation.toHELM().equals(""))) {
          connections.add(convertConnection(connectionNotation.toHELM(), source, target, convertsortedIdstoIds));
          connections.add(convertConnection(connectionNotation.toReverseHELM(), source, target, convertsortedIdstoIds));
          Collections.sort(connections);
          notation.append(connections.get(0) + "|");
        }
      }
      if (notation.length() > 1) {
        notation.setLength(notation.length() - 1);
      }
      return notation.toString();
    }
docs: method to generate a canonical HELM 1 connection section
  
  @param convertsortedIdstoIds Map of old ids with the equivalent new ids
  @return second section of HELM
  @throws HELM1ConverterException