@Override
  public Integer offsetComparator(String offset1, String offset2) {
    if (offset1 == null && offset2 == null) {
      return 0;
    } else if (offset1 == null) {
      return -1;
    } else if (offset2 == null) {
      return 1;
    } else {
      return Integer.compare(Integer.parseInt(offset1), Integer.parseInt(offset2));
    }
  }
Compare the two offsets. -1, 0, +1 means offset1 &lt; offset2,
offset1 == offset2 and offset1 &gt; offset2 respectively. Return
null if those two offsets are not comparable

@param offset1 First offset for comparison.
@param offset2 Second offset for comparison.
@return -1 if offset1 &lt; offset2; 0 if offset1 == offset2; 1 if offset1 &gt; offset2. Null if not comparable
samza-core/src/main/java/org/apache/samza/system/inmemory/InMemorySystemAdmin.java