code: public static Optional<NmeaMessage> concatenateMessages(List<NmeaMessage> list) {
          if (list.size() == 1)
              return Optional.of(list.get(0));
  
          NmeaMessage first = list.get(0);
          // concatenate column 5 and use row 1 tag block
  
          // copy tags so we can modify
          LinkedHashMap<String, String> tags = new LinkedHashMap<String, String>(first.getTags());
  
          StringBuilder s = new StringBuilder();
          List<String> foundItems = null;
          for (NmeaMessage t : list) {
              if (!t.getItems().isEmpty()) {
                  // parse the num and count values from the NMEA colums
                  // an VSI message will fail this check
                  try {
                      Integer.parseInt(t.getItems().get(1));
                      Integer.parseInt(t.getItems().get(2));
                      s.append(t.getItems().get(COLUMN_TO_AGGREGATE));
                      foundItems = t.getItems();
                  } catch (NumberFormatException e) {
                      // ignore
                  }
              }
          }
          if (foundItems == null) {
              return Optional.absent();
          }
          // copy cols so we can modify, don't want to affect the original nmea
          // message
          List<String> cols = Lists.newArrayList(foundItems);
          cols.set(COLUMN_TO_AGGREGATE, s.toString());
          // set num sentences to be 1 and current sentence number to be 1
          cols.set(1, "1");
          cols.set(2, "1");
  
          tags.put("g", "1-1-" + first.getSentenceGroupId());
          try {
              String checksum = NmeaUtil.getChecksum(NmeaUtil.createNmeaLine(tags, cols));
              NmeaMessage message = new NmeaMessage(tags, cols, checksum);
              return Optional.of(message);
          } catch (NmeaMessageParseException e) {
              return Optional.absent();
          }
      }
docs: Returns the aggregated message or if an {@link NmeaMessageParseException}
  occurs returns null.
  
  @param list
  @return