@Test
public void compareTo() throws Exception {

    List<Migration> migrations = new ArrayList<>();
    migrations.add(new MigrationStub(2, 3));
    migrations.add(new MigrationStub(1, 2));
    migrations.add(new MigrationStub(1, 3));
    migrations.add(new MigrationStub(3, 4));
    Collections.sort(migrations);
    assertThat(migrations.get(0), equalTo(new MigrationStub(1, 3)));
    assertThat(migrations.get(1), equalTo(new MigrationStub(1, 2)));
    assertThat(migrations.get(2), equalTo(new MigrationStub(2, 3)));
    assertThat(migrations.get(3), equalTo(new MigrationStub(3, 4)));
}