### Question:
MigrationsInDir implements Migrations { @Override public Iterable<File> asIterable() { ArrayList<File> list = new ArrayList<File>(Arrays.asList(migrationFiles)); Collections.sort(list, comparator); return list; } MigrationsInDir(File directory);  MigrationsInDir(File directory, Comparator<File> comparator); @Override Iterable<File> asIterable();  }### Answer:
@Test public void shouldIterateInCorrectOrder() throws Exception { Iterator<File> iterator = migrations.asIterable().iterator(); assertStartsWithNumber(iterator.next(), 1); assertStartsWithNumber(iterator.next(), 2); assertStartsWithNumber(iterator.next(), 3); }