@Test
public void testCompareWithGTID() {

  String gtid1 = UUID1 + ":1-200";
  String gtid2 = UUID1 + ":1-300";
  String gtid3 = UUID1 + ":1-200," + UUID2 + ":1-456";
  BinlogFilePos first = new BinlogFilePos("mysql-bin-changelog.218", 123, 456, gtid1, UUID1);
  BinlogFilePos second = new BinlogFilePos("mysql-bin-changelog.218", 456, 789, gtid2, UUID1);
  BinlogFilePos third = new BinlogFilePos("mysql-bin-changelog.100", 10, 24, gtid1, UUID2);
  BinlogFilePos fourth = new BinlogFilePos("mysql-bin-changelog.100", 20, 24, gtid3, UUID2);
  // server_uuid matches, compare binlog file number and position
  assertTrue(first.compareTo(second) < 0);
  // server_uuid doesn't match, compare GTID
  assertEquals(0, first.compareTo(third));
  assertTrue(first.compareTo(fourth) < 0);
  assertTrue(second.compareTo(third) > 0);
}