code: private Integer findClosestMatchingMessageInTermsOfArrivalTime(long time,
  			String checksum) {
  		// find the closest matching ais message in terms of arrival time
  		Long lowestTimeDiff = null;
  		Integer lowestTimeDiffIndex = null;
  		for (int i = 0; i < getNumLines(); i++) {
  			String msg = getLine(i);
  			Long msgTime = getLineTime(i);
  			if (!isExactEarthTimestamp(msg)) {
  				try {
  					AisNmeaMessage nmea = new AisNmeaMessage(msg);
  					if (nmea.getChecksum().equals(checksum)) {
  						long diff = Math.abs(msgTime - time);
  						boolean closer = (lowestTimeDiff == null || diff < lowestTimeDiff)
  								&& (diff <= MAXIMUM_ARRIVAL_TIME_DIFFERENCE_MS);
  						if (closer) {
  							lowestTimeDiff = diff;
  							lowestTimeDiffIndex = i;
  						}
  					}
  				} catch (AisParseException e) {
  					log.debug(e.getMessage());
  				}
  			}
  		}
  		return lowestTimeDiffIndex;
  	}
docs: Returns the index of the closest matching message in terms of arrival
  time. Matching equates to having a referenced checksum. If not found
  returns null. If there is a problem parsing the message an
  {@link AisParseException} is thrown.
  
  @param time
  @param checksum
  @return