code: private static List<ConnectionNotation> getAllSelfCycleConnections(List<ConnectionNotation> connections) {
      List<ConnectionNotation> listSelfCycle = new ArrayList<ConnectionNotation>();
      for (ConnectionNotation connection : connections) {
        if ((connection.getTargetId().getId().equals(connection.getSourceId().getId()))) {
          listSelfCycle.add(connection);
        }
      }
      return listSelfCycle;
    }
docs: method to get all self-cycle Connections
  
  @param connections list of ConnectionNotation
  @return list of all self-cycle Connections