### Question:
DiscoveryService { List<Migration> findMigrations(MigrationContext context) { List<Migration> migrations = new ArrayList<>(); try { for (Discoverer discoverer : this.discoverers) { migrations.addAll(discoverer.discoverMigrations(context)); } } catch (Exception e) { throw new MigrationsException("Unexpected error while scanning for migrations", e); } Collections .sort(migrations, Comparator.comparing(Migration::getVersion, new MigrationVersion.VersionComparator())); return Collections.unmodifiableList(migrations); } DiscoveryService();   }### Answer:
@Test void shouldDiscoverMigrationsInCorrectOrder() { MigrationContext context = new DefaultMigrationContext(MigrationsConfig.builder() .withPackagesToScan( "ac.simons.neo4j.migrations.core.test_migrations.changeset3", "ac.simons.neo4j.migrations.core.test_migrations.changeset1", "ac.simons.neo4j.migrations.core.test_migrations.changeset2") .withLocationsToScan("classpath:/my/awesome/migrations") .build(), Mockito.mock(Driver.class)); List<Migration> migrations = new DiscoveryService().findMigrations(context); assertThat(migrations).hasSize(7) .extracting(Migration::getDescription) .containsExactly("FirstMigration", "AnotherMigration", "InnerMigration", "BondTheNameIsBond", "Die halbe Wahrheit", "NichtsIstWieEsScheint", "MirFallenKeineNamenEin"); }