code: @Override
      public int compareTo(final Record other) {
          final URI thisID = getID();
          final URI otherID = other.getID();
          if (thisID == null) {
              return otherID == null ? 0 : -1;
          } else {
              return otherID == null ? 1 : thisID.stringValue().compareTo(otherID.stringValue());
          }
      }
docs: {@inheritDoc} Comparison is based on the record IDs only.