V2StorageMigration implements StorageMigration { @Override public void migrate(final FileSystem fileSystem) { Path usersRoot = fileSystem.getPath(UserExperimentalFeaturesStorageImpl.USER_FOLDER_ROOT); try (DirectoryStream<Path> stream = ioService.newDirectoryStream(usersRoot)) { stream.forEach(folder -> { String folderName = Paths.convert(folder).getFileName(); Path newFolder = usersRoot.resolve(UserExperimentalFeaturesStorageImpl.encode(folderName)); ioService.move(folder, newFolder); }); } } @Inject  V2StorageMigration(@Named("configIO") final IOService ioService); @Override int getTargetVersion(); @Override void migrate(final FileSystem fileSystem);  }
@Test public void testMigration() { migration.migrate(fileSystem); usernames.forEach(this::validateUserSettings); }