code: @Override
      public int compareTo(final KafkaMessageId id) {
          // instance is always > null
          if (id == null) {
              return 1;
          }
          // use signum to perform the comparison, mark _partition more significant than _offset
          return 2 * Integer.signum(_partition - id.getPartition()) + Long.signum(_offset - id.getOffset());
      }
docs: Compares this {@link KafkaMessageId} to {@code id}. Comparison is made numerically, where the partition is
  considered more significant than the offset within the partition. The resulting ordering of
  {@link KafkaMessageId} is identical to the ordering in a kafka partition.
  An instance is considered greater than {@code null}.
  
  @param id The {@link KafkaMessageId} to compare with.
  @return The result of {@code 2 * signum(partition - id.getPartition()) + signum(offset - id.getOffset())} or
  {@code 1} if {@code id} is null.