@Override
    public boolean equals(Object obj) {
      if (this == obj)
        return true;
      if (obj == null)
        return false;
      if (getClass() != obj.getClass())
        return false;
      SystemStreamPartitionMetadata other = (SystemStreamPartitionMetadata) obj;
      if (newestOffset == null) {
        if (other.newestOffset != null)
          return false;
      } else if (!newestOffset.equals(other.newestOffset))
        return false;
      if (oldestOffset == null) {
        if (other.oldestOffset != null)
          return false;
      } else if (!oldestOffset.equals(other.oldestOffset))
        return false;
      if (upcomingOffset == null) {
        if (other.upcomingOffset != null)
          return false;
      } else if (!upcomingOffset.equals(other.upcomingOffset))
        return false;
      return true;
    }
@param offsetType
         The type of offset to get. Either oldest, newest, or upcoming.
@return The corresponding offset for the offset type requested.
samza-api/src/main/java/org/apache/samza/system/SystemStreamMetadata.java