@Test public void translatorShouldMergeKeys() { initPrefs("pear", "anjou"); PrefMigrator.migrate(prefs, KEY_MERGER); assertPrefs("fruit", "pear_anjou"); initPrefs("melon", "watermelon"); PrefMigrator.migrate(prefs, KEY_MERGER); assertPrefs("fruit", "melon_watermelon"); }
public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } private  PrefMigrator(); }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs(); }
PrefMigrator { public static void migrate(SharedPreferences prefs, Migration... migrations) { for (Migration migration : migrations) { migration.apply(prefs); } } private  PrefMigrator(); static void migrate(SharedPreferences prefs, Migration... migrations); static void migrateSharedPrefs();  }