in pekko-sample-persistence-dc-java/src/main/java/sample/persistence/res/auction/AuctionEntity.java [154:165]
static Boolean isHigherBid(Bid first, Bid second) {
return first.offer > second.offer
|| (first.offer == second.offer && first.timestamp.isBefore(second.timestamp))
|| // if equal, first one wins
// If timestamps are equal, choose by dc where the offer was submitted
// In real auctions, this last comparison should be deterministic but unpredictable, so
// that submitting to a
// particular DC would not be an advantage.
(first.offer == second.offer
&& first.timestamp.equals(second.timestamp)
&& first.originReplica.id().compareTo(second.originReplica.id()) < 0);
}